1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_COMMON_H_
6 #define COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_COMMON_H_
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/ref_counted_memory.h"
12 #include "base/time/time.h"
13 #include "third_party/skia/include/core/SkBitmap.h"
15 namespace search_provider_logos
{
17 // The maximum number of milliseconds that a logo can be cached.
18 extern const int64 kMaxTimeToLiveMS
;
24 // For use by the client ----------------------------------------------------
26 // The URL to load when the logo is clicked.
27 std::string on_click_url
;
28 // The accessibility text for the logo.
30 // The mime type of the logo image.
31 std::string mime_type
;
32 // The URL for an animated image to display when the call to action logo is
33 // clicked. If |animated_url| is not empty, |encoded_image| refers to a call
35 std::string animated_url
;
37 // For use by LogoTracker ---------------------------------------------------
39 // The URL from which the logo was downloaded (without the fingerprint param).
40 std::string source_url
;
41 // A fingerprint (i.e. hash) identifying the logo. Used when revalidating the
42 // logo with the server.
43 std::string fingerprint
;
44 // Whether the logo can be shown optimistically after it's expired while a
45 // fresh logo is being downloaded.
46 bool can_show_after_expiration
;
47 // When the logo expires. After this time, the logo will not be used and will
49 base::Time expiration_time
;
56 // The jpeg- or png-encoded image.
57 scoped_refptr
<base::RefCountedString
> encoded_image
;
58 // Metadata about the logo.
59 LogoMetadata metadata
;
68 // Metadata about the logo.
69 LogoMetadata metadata
;
72 } // namespace search_provider_logos
74 #endif // COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_COMMON_H_