Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Side by Side Diff: chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h

Issue 2611623003: Use exact pixel sizes instead of dip in webapp/WebAPK installability code (Closed)
Patch Set: Rebased version of pkotwicz@'s original patch Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 const SkBitmap& icon) = 0; 62 const SkBitmap& icon) = 0;
63 63
64 protected: 64 protected:
65 virtual ~Observer() {} 65 virtual ~Observer() {}
66 }; 66 };
67 67
68 // Initialize the fetcher by requesting the information about the page from 68 // Initialize the fetcher by requesting the information about the page from
69 // the renderer process. The initialization is asynchronous and 69 // the renderer process. The initialization is asynchronous and
70 // OnDidGetWebApplicationInfo is expected to be called when finished. 70 // OnDidGetWebApplicationInfo is expected to be called when finished.
71 AddToHomescreenDataFetcher(content::WebContents* web_contents, 71 AddToHomescreenDataFetcher(content::WebContents* web_contents,
72 int ideal_icon_size_in_dp, 72 int ideal_icon_size_in_px,
73 int minimum_icon_size_in_dp, 73 int minimum_icon_size_in_px,
74 int ideal_splash_image_size_in_dp, 74 int ideal_splash_image_size_in_px,
75 int minimum_splash_image_size_in_dp, 75 int minimum_splash_image_size_in_px,
76 bool check_webapk_compatible, 76 bool check_webapk_compatible,
77 Observer* observer); 77 Observer* observer);
78 78
79 // Returns a callback which fetches the splash screen image to be stored for 79 // Returns a callback which fetches the splash screen image to be stored for
80 // the webapp with the specified |id|. 80 // the webapp with the specified |id|.
81 base::Closure FetchSplashScreenImageCallback(const std::string& id); 81 base::Closure FetchSplashScreenImageCallback(const std::string& id);
82 82
83 // IPC message received when the initialization is finished. 83 // IPC message received when the initialization is finished.
84 void OnDidGetWebApplicationInfo(const WebApplicationInfo& web_app_info); 84 void OnDidGetWebApplicationInfo(const WebApplicationInfo& web_app_info);
85 85
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 Observer* weak_observer_; 124 Observer* weak_observer_;
125 125
126 // The icon must only be set on the UI thread for thread safety. 126 // The icon must only be set on the UI thread for thread safety.
127 SkBitmap shortcut_icon_; 127 SkBitmap shortcut_icon_;
128 ShortcutInfo shortcut_info_; 128 ShortcutInfo shortcut_info_;
129 GURL splash_screen_url_; 129 GURL splash_screen_url_;
130 130
131 base::CancelableTaskTracker favicon_task_tracker_; 131 base::CancelableTaskTracker favicon_task_tracker_;
132 base::Timer data_timeout_timer_; 132 base::Timer data_timeout_timer_;
133 133
134 const int ideal_icon_size_in_dp_; 134 const int ideal_icon_size_in_px_;
135 const int minimum_icon_size_in_dp_; 135 const int minimum_icon_size_in_px_;
136 const int ideal_splash_image_size_in_dp_; 136 const int ideal_splash_image_size_in_px_;
137 const int minimum_splash_image_size_in_dp_; 137 const int minimum_splash_image_size_in_px_;
138 138
139 // Indicates whether to check WebAPK compatibility. 139 // Indicates whether to check WebAPK compatibility.
140 bool check_webapk_compatibility_; 140 bool check_webapk_compatibility_;
141 bool is_waiting_for_web_application_info_; 141 bool is_waiting_for_web_application_info_;
142 bool is_installable_check_complete_; 142 bool is_installable_check_complete_;
143 bool is_icon_saved_; 143 bool is_icon_saved_;
144 bool is_ready_; 144 bool is_ready_;
145 145
146 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDataFetcher); 146 DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDataFetcher);
147 }; 147 };
148 148
149 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DATA_FETCHER_H_ 149 #endif // CHROME_BROWSER_ANDROID_WEBAPPS_ADD_TO_HOMESCREEN_DATA_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698