Chromium Code Reviews| 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_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DATA_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DATA_FETCHER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DATA_FETCHER_H_ | 6 #define CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DATA_FETCHER_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
|
dominickn
2017/03/01 02:29:40
This include isn't needed any more.
| |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/task/cancelable_task_tracker.h" | 11 #include "base/task/cancelable_task_tracker.h" |
| 12 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
| 13 #include "chrome/browser/android/shortcut_info.h" | 13 #include "chrome/browser/android/shortcut_info.h" |
| 14 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
| 15 #include "third_party/skia/include/core/SkBitmap.h" | 15 #include "third_party/skia/include/core/SkBitmap.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class TaskRunner; | 18 class TaskRunner; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 // OnDidGetWebApplicationInfo is expected to be called when finished. | 75 // OnDidGetWebApplicationInfo is expected to be called when finished. |
| 76 AddToHomescreenDataFetcher(content::WebContents* web_contents, | 76 AddToHomescreenDataFetcher(content::WebContents* web_contents, |
| 77 int ideal_icon_size_in_px, | 77 int ideal_icon_size_in_px, |
| 78 int minimum_icon_size_in_px, | 78 int minimum_icon_size_in_px, |
| 79 int ideal_splash_image_size_in_px, | 79 int ideal_splash_image_size_in_px, |
| 80 int minimum_splash_image_size_in_px, | 80 int minimum_splash_image_size_in_px, |
| 81 int badge_size_in_px, | 81 int badge_size_in_px, |
| 82 bool check_webapk_compatible, | 82 bool check_webapk_compatible, |
| 83 Observer* observer); | 83 Observer* observer); |
| 84 | 84 |
| 85 // Returns a callback which fetches the splash screen image to be stored for | |
| 86 // the webapp with the specified |id|. | |
| 87 base::Closure FetchSplashScreenImageCallback(const std::string& id); | |
| 88 | |
| 89 // IPC message received when the initialization is finished. | 85 // IPC message received when the initialization is finished. |
| 90 void OnDidGetWebApplicationInfo(const WebApplicationInfo& web_app_info); | 86 void OnDidGetWebApplicationInfo(const WebApplicationInfo& web_app_info); |
| 91 | 87 |
| 92 // Accessors, etc. | 88 // Accessors, etc. |
| 93 void set_weak_observer(Observer* observer) { weak_observer_ = observer; } | 89 void set_weak_observer(Observer* observer) { weak_observer_ = observer; } |
| 94 bool is_ready() const { return is_ready_; } | 90 bool is_ready() const { return is_ready_; } |
| 95 const SkBitmap& badge_icon() const { return badge_icon_; } | 91 const SkBitmap& badge_icon() const { return badge_icon_; } |
| 96 const SkBitmap& primary_icon() const { return primary_icon_; } | 92 const SkBitmap& primary_icon() const { return primary_icon_; } |
| 97 ShortcutInfo& shortcut_info() { return shortcut_info_; } | 93 ShortcutInfo& shortcut_info() { return shortcut_info_; } |
| 98 | 94 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 129 void NotifyObserver(const SkBitmap& icon); | 125 void NotifyObserver(const SkBitmap& icon); |
| 130 | 126 |
| 131 scoped_refptr<base::TaskRunner> background_task_runner_; | 127 scoped_refptr<base::TaskRunner> background_task_runner_; |
| 132 | 128 |
| 133 Observer* weak_observer_; | 129 Observer* weak_observer_; |
| 134 | 130 |
| 135 // The icons must only be set on the UI thread for thread safety. | 131 // The icons must only be set on the UI thread for thread safety. |
| 136 SkBitmap badge_icon_; | 132 SkBitmap badge_icon_; |
| 137 SkBitmap primary_icon_; | 133 SkBitmap primary_icon_; |
| 138 ShortcutInfo shortcut_info_; | 134 ShortcutInfo shortcut_info_; |
| 139 GURL splash_screen_url_; | |
| 140 | 135 |
| 141 base::CancelableTaskTracker favicon_task_tracker_; | 136 base::CancelableTaskTracker favicon_task_tracker_; |
| 142 base::Timer data_timeout_timer_; | 137 base::Timer data_timeout_timer_; |
| 143 | 138 |
| 144 const int ideal_icon_size_in_px_; | 139 const int ideal_icon_size_in_px_; |
| 145 const int minimum_icon_size_in_px_; | 140 const int minimum_icon_size_in_px_; |
| 146 const int ideal_splash_image_size_in_px_; | 141 const int ideal_splash_image_size_in_px_; |
| 147 const int minimum_splash_image_size_in_px_; | 142 const int minimum_splash_image_size_in_px_; |
| 148 const int badge_size_in_px_; | 143 const int badge_size_in_px_; |
| 149 | 144 |
| 150 // Indicates whether to check WebAPK compatibility. | 145 // Indicates whether to check WebAPK compatibility. |
| 151 bool check_webapk_compatibility_; | 146 bool check_webapk_compatibility_; |
| 152 bool is_waiting_for_web_application_info_; | 147 bool is_waiting_for_web_application_info_; |
| 153 bool is_installable_check_complete_; | 148 bool is_installable_check_complete_; |
| 154 bool is_icon_saved_; | 149 bool is_icon_saved_; |
| 155 bool is_ready_; | 150 bool is_ready_; |
| 156 | 151 |
| 157 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDataFetcher); | 152 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDataFetcher); |
| 158 }; | 153 }; |
| 159 | 154 |
| 160 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DATA_FETCHER_H_ | 155 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DATA_FETCHER_H_ |
| OLD | NEW |