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

Side by Side Diff: chrome/browser/android/shortcut_helper.h

Issue 2773353002: Make minimum PWA icon size the same accross all device densities
Patch Set: Merge branch 'master' into min_size Created 3 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_SHORTCUT_HELPER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_
6 #define CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ 6 #define CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 const SkBitmap& icon_bitmap, 47 const SkBitmap& icon_bitmap,
48 const WebApkInstallService::FinishCallback& callback); 48 const WebApkInstallService::FinishCallback& callback);
49 49
50 // Shows toast notifying user that a WebAPK install is already in progress 50 // Shows toast notifying user that a WebAPK install is already in progress
51 // when user tries to queue a new install for the same WebAPK. 51 // when user tries to queue a new install for the same WebAPK.
52 static void ShowWebApkInstallInProgressToast(); 52 static void ShowWebApkInstallInProgressToast();
53 53
54 // Returns the ideal size for an icon representing a web app or a WebAPK. 54 // Returns the ideal size for an icon representing a web app or a WebAPK.
55 static int GetIdealHomescreenIconSizeInPx(); 55 static int GetIdealHomescreenIconSizeInPx();
56 56
57 // Returns the minimum size for an icon representing a web app or a WebAPK.
58 static int GetMinimumHomescreenIconSizeInPx();
59
60 // Returns the ideal size for an image displayed on a web app's splash 57 // Returns the ideal size for an image displayed on a web app's splash
61 // screen. 58 // screen.
62 static int GetIdealSplashImageSizeInPx(); 59 static int GetIdealSplashImageSizeInPx();
63 60
64 // Returns the minimum size for an image displayed on a web app's splash
65 // screen.
66 static int GetMinimumSplashImageSizeInPx();
67
68 // Returns the ideal size for a badge icon of a WebAPK. 61 // Returns the ideal size for a badge icon of a WebAPK.
69 static int GetIdealBadgeIconSizeInPx(); 62 static int GetIdealBadgeIconSizeInPx();
70 63
71 // Fetches the splash screen image and stores it inside the WebappDataStorage 64 // Fetches the splash screen image and stores it inside the WebappDataStorage
72 // of the webapp. The WebappDataStorage object *must* have been previously 65 // of the webapp. The WebappDataStorage object *must* have been previously
73 // created by |AddShortcutInBackgroundWithSkBitmap|; this method should be 66 // created by |AddShortcutInBackgroundWithSkBitmap|; this method should be
74 // passed as a closure to that method. 67 // passed as a closure to that method.
75 static void FetchSplashScreenImage(content::WebContents* web_contents, 68 static void FetchSplashScreenImage(content::WebContents* web_contents,
76 const GURL& image_url, 69 const GURL& image_url,
77 const int ideal_splash_image_size_in_px, 70 const int ideal_splash_image_size_in_px,
78 const int minimum_splash_image_size_in_px,
79 const std::string& webapp_id); 71 const std::string& webapp_id);
80 72
81 // Stores the webapp splash screen in the WebappDataStorage associated with 73 // Stores the webapp splash screen in the WebappDataStorage associated with
82 // |webapp_id|. 74 // |webapp_id|.
83 static void StoreWebappSplashImage(const std::string& webapp_id, 75 static void StoreWebappSplashImage(const std::string& webapp_id,
84 const SkBitmap& splash_image); 76 const SkBitmap& splash_image);
85 77
86 // Returns the given icon, modified to match the launcher requirements. 78 // Returns the given icon, modified to match the launcher requirements.
87 // This method may generate an entirely new icon; if this is the case, 79 // This method may generate an entirely new icon; if this is the case,
88 // |is_generated| will be set to |true|. 80 // |is_generated| will be set to |true|.
(...skipping 18 matching lines...) Expand all
107 99
108 // Fetches information on all the WebAPKs installed on the device and returns 100 // Fetches information on all the WebAPKs installed on the device and returns
109 // the info to the |callback|. 101 // the info to the |callback|.
110 static void RetrieveWebApks(const WebApkInfoCallback& callback); 102 static void RetrieveWebApks(const WebApkInfoCallback& callback);
111 103
112 private: 104 private:
113 DISALLOW_IMPLICIT_CONSTRUCTORS(ShortcutHelper); 105 DISALLOW_IMPLICIT_CONSTRUCTORS(ShortcutHelper);
114 }; 106 };
115 107
116 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ 108 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698