| 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/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/task/cancelable_task_tracker.h" | 9 #include "base/task/cancelable_task_tracker.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // Called when all the data needed to create a shortcut is available. | 47 // Called when all the data needed to create a shortcut is available. |
| 48 virtual void OnDataAvailable(const ShortcutInfo& info, | 48 virtual void OnDataAvailable(const ShortcutInfo& info, |
| 49 const SkBitmap& icon) = 0; | 49 const SkBitmap& icon) = 0; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 // Initialize the fetcher by requesting the information about the page to the | 52 // Initialize the fetcher by requesting the information about the page to the |
| 53 // renderer process. The initialization is asynchronous and | 53 // renderer process. The initialization is asynchronous and |
| 54 // OnDidGetWebApplicationInfo is expected to be called when finished. | 54 // OnDidGetWebApplicationInfo is expected to be called when finished. |
| 55 AddToHomescreenDataFetcher(content::WebContents* web_contents, | 55 AddToHomescreenDataFetcher(content::WebContents* web_contents, |
| 56 int ideal_splash_image_size_in_dp, | 56 int ideal_splash_image_size_in_dp, |
| 57 int minimum_splash_image_size_in_dp, |
| 57 int ideal_icon_size_in_dp, | 58 int ideal_icon_size_in_dp, |
| 59 int minimum_icon_size_in_dp, |
| 58 Observer* observer); | 60 Observer* observer); |
| 59 | 61 |
| 60 // Called to fetch the splash screen image to be stored for the webapp with | 62 // Called to fetch the splash screen image to be stored for the webapp with |
| 61 // the specified |id|. | 63 // the specified |id|. |
| 62 void FetchSplashScreenImage(const std::string& id); | 64 void FetchSplashScreenImage(const std::string& id); |
| 63 | 65 |
| 64 // IPC message received when the initialization is finished. | 66 // IPC message received when the initialization is finished. |
| 65 void OnDidGetWebApplicationInfo(const WebApplicationInfo& web_app_info); | 67 void OnDidGetWebApplicationInfo(const WebApplicationInfo& web_app_info); |
| 66 | 68 |
| 67 // Called when the Manifest has been parsed, or if no Manifest was found. | 69 // Called when the Manifest has been parsed, or if no Manifest was found. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 bool is_ready_; | 104 bool is_ready_; |
| 103 base::Timer icon_timeout_timer_; | 105 base::Timer icon_timeout_timer_; |
| 104 ShortcutInfo shortcut_info_; | 106 ShortcutInfo shortcut_info_; |
| 105 GURL splash_screen_url_; | 107 GURL splash_screen_url_; |
| 106 | 108 |
| 107 // The icon must only be set on the UI thread for thread safety. | 109 // The icon must only be set on the UI thread for thread safety. |
| 108 SkBitmap shortcut_icon_; | 110 SkBitmap shortcut_icon_; |
| 109 base::CancelableTaskTracker favicon_task_tracker_; | 111 base::CancelableTaskTracker favicon_task_tracker_; |
| 110 | 112 |
| 111 const int ideal_splash_image_size_in_dp_; | 113 const int ideal_splash_image_size_in_dp_; |
| 114 const int minimum_splash_image_size_in_dp_; |
| 112 const int ideal_icon_size_in_dp_; | 115 const int ideal_icon_size_in_dp_; |
| 116 const int minimum_icon_size_in_dp_; |
| 113 | 117 |
| 114 friend class base::RefCounted<AddToHomescreenDataFetcher>; | 118 friend class base::RefCounted<AddToHomescreenDataFetcher>; |
| 115 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDataFetcher); | 119 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDataFetcher); |
| 116 }; | 120 }; |
| 117 | 121 |
| 118 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DATA_FETCHER_H_ | 122 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DATA_FETCHER_H_ |
| OLD | NEW |