OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_H_ |
6 #define CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_H_ | 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 const base::string16& title); | 116 const base::string16& title); |
117 | 117 |
118 // Records that a banner was shown. The |event_name| corresponds to the RAPPOR | 118 // Records that a banner was shown. The |event_name| corresponds to the RAPPOR |
119 // metric being recorded. | 119 // metric being recorded. |
120 void RecordDidShowBanner(const std::string& event_name); | 120 void RecordDidShowBanner(const std::string& event_name); |
121 | 121 |
122 private: | 122 private: |
123 // Callbacks for data retrieval. | 123 // Callbacks for data retrieval. |
124 void OnDidGetManifest(const content::Manifest& manifest); | 124 void OnDidGetManifest(const content::Manifest& manifest); |
125 void OnDidCheckHasServiceWorker(bool has_service_worker); | 125 void OnDidCheckHasServiceWorker(bool has_service_worker); |
126 void OnFetchComplete(const GURL url, const SkBitmap* icon) override; | 126 void OnFetchComplete(const GURL& url, const SkBitmap* icon) override; |
127 | 127 |
128 // Shows a banner for the app, if the given |icon| is valid. | 128 // Shows a banner for the app, if the given |icon| is valid. |
129 virtual void ShowBanner(const SkBitmap* icon); | 129 virtual void ShowBanner(const SkBitmap* icon); |
130 | 130 |
131 // Record that the banner could be shown at this point, if the triggering | 131 // Record that the banner could be shown at this point, if the triggering |
132 // heuristic allowed. | 132 // heuristic allowed. |
133 void RecordCouldShowBanner(); | 133 void RecordCouldShowBanner(); |
134 | 134 |
135 // Returns whether the banner should be shown. | 135 // Returns whether the banner should be shown. |
136 bool CheckIfShouldShowBanner(); | 136 bool CheckIfShouldShowBanner(); |
(...skipping 14 matching lines...) Expand all Loading... |
151 content::Manifest web_app_data_; | 151 content::Manifest web_app_data_; |
152 | 152 |
153 friend class AppBannerDataFetcherUnitTest; | 153 friend class AppBannerDataFetcherUnitTest; |
154 friend class base::RefCounted<AppBannerDataFetcher>; | 154 friend class base::RefCounted<AppBannerDataFetcher>; |
155 DISALLOW_COPY_AND_ASSIGN(AppBannerDataFetcher); | 155 DISALLOW_COPY_AND_ASSIGN(AppBannerDataFetcher); |
156 }; | 156 }; |
157 | 157 |
158 } // namespace banners | 158 } // namespace banners |
159 | 159 |
160 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_H_ | 160 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_DATA_FETCHER_H_ |
OLD | NEW |