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/macros.h" | 9 #include "base/macros.h" |
9 #include "base/task/cancelable_task_tracker.h" | 10 #include "base/task/cancelable_task_tracker.h" |
10 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
11 #include "chrome/browser/android/shortcut_info.h" | 12 #include "chrome/browser/android/shortcut_info.h" |
12 #include "chrome/common/web_application_info.h" | 13 #include "chrome/common/web_application_info.h" |
13 #include "components/favicon_base/favicon_types.h" | 14 #include "components/favicon_base/favicon_types.h" |
14 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
15 #include "content/public/common/manifest.h" | 16 #include "content/public/common/manifest.h" |
16 | 17 |
17 namespace content { | 18 namespace content { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // Initialize the fetcher by requesting the information about the page to the | 56 // Initialize the fetcher by requesting the information about the page to the |
56 // renderer process. The initialization is asynchronous and | 57 // renderer process. The initialization is asynchronous and |
57 // OnDidGetWebApplicationInfo is expected to be called when finished. | 58 // OnDidGetWebApplicationInfo is expected to be called when finished. |
58 AddToHomescreenDataFetcher(content::WebContents* web_contents, | 59 AddToHomescreenDataFetcher(content::WebContents* web_contents, |
59 int ideal_icon_size_in_dp, | 60 int ideal_icon_size_in_dp, |
60 int minimum_icon_size_in_dp, | 61 int minimum_icon_size_in_dp, |
61 int ideal_splash_image_size_in_dp, | 62 int ideal_splash_image_size_in_dp, |
62 int minimum_splash_image_size_in_dp, | 63 int minimum_splash_image_size_in_dp, |
63 Observer* observer); | 64 Observer* observer); |
64 | 65 |
65 // Called to fetch the splash screen image to be stored for the webapp with | 66 // Returns a callback which fetches the splash screen image to be stored for |
66 // the specified |id|. | 67 // the webapp with the specified |id|. |
67 void FetchSplashScreenImage(const std::string& id); | 68 base::Closure FetchSplashScreenImageCallback(const std::string& id); |
68 | 69 |
69 // IPC message received when the initialization is finished. | 70 // IPC message received when the initialization is finished. |
70 void OnDidGetWebApplicationInfo(const WebApplicationInfo& web_app_info); | 71 void OnDidGetWebApplicationInfo(const WebApplicationInfo& web_app_info); |
71 | 72 |
72 // Called when the Manifest has been parsed, or if no Manifest was found. | 73 // Called when the Manifest has been parsed, or if no Manifest was found. |
73 void OnDidGetManifest(const content::Manifest& manifest); | 74 void OnDidGetManifest(const content::Manifest& manifest); |
74 | 75 |
75 // Accessors, etc. | 76 // Accessors, etc. |
76 void set_weak_observer(Observer* observer) { weak_observer_ = observer; } | 77 void set_weak_observer(Observer* observer) { weak_observer_ = observer; } |
77 bool is_ready() { return is_ready_; } | 78 bool is_ready() { return is_ready_; } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 const int ideal_icon_size_in_dp_; | 122 const int ideal_icon_size_in_dp_; |
122 const int minimum_icon_size_in_dp_; | 123 const int minimum_icon_size_in_dp_; |
123 const int ideal_splash_image_size_in_dp_; | 124 const int ideal_splash_image_size_in_dp_; |
124 const int minimum_splash_image_size_in_dp_; | 125 const int minimum_splash_image_size_in_dp_; |
125 | 126 |
126 friend class base::RefCounted<AddToHomescreenDataFetcher>; | 127 friend class base::RefCounted<AddToHomescreenDataFetcher>; |
127 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDataFetcher); | 128 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDataFetcher); |
128 }; | 129 }; |
129 | 130 |
130 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DATA_FETCHER_H_ | 131 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DATA_FETCHER_H_ |
OLD | NEW |