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
;
33 // For use by LogoTracker ---------------------------------------------------
35 // The URL from which the logo was downloaded (without the fingerprint param).
36 std::string source_url
;
37 // A fingerprint (i.e. hash) identifying the logo. Used when revalidating the
38 // logo with the server.
39 std::string fingerprint
;
40 // Whether the logo can be shown optimistically after it's expired while a
41 // fresh logo is being downloaded.
42 bool can_show_after_expiration
;
43 // When the logo expires. After this time, the logo will not be used and will
45 base::Time expiration_time
;
52 // The jpeg- or png-encoded image.
53 scoped_refptr
<base::RefCountedString
> encoded_image
;
54 // Metadata about the logo.
55 LogoMetadata metadata
;
64 // Metadata about the logo.
65 LogoMetadata metadata
;
68 } // namespace search_provider_logos
70 #endif // COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_COMMON_H_