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_SHORTCUT_INFO_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_SHORTCUT_INFO_H_ |
6 #define CHROME_BROWSER_ANDROID_SHORTCUT_INFO_H_ | 6 #define CHROME_BROWSER_ANDROID_SHORTCUT_INFO_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "content/public/common/manifest.h" | 13 #include "content/public/common/manifest.h" |
14 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" | 14 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" |
15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
16 | 16 |
17 // Information needed to create a shortcut via ShortcutHelper. | 17 // Information needed to create a shortcut via ShortcutHelper. |
18 struct ShortcutInfo { | 18 struct ShortcutInfo { |
19 | 19 |
20 // This enum is used to back a UMA histogram, and must be treated as | 20 // This enum is used to back a UMA histogram, and must be treated as |
21 // append-only. | 21 // append-only. |
22 // A Java counterpart will be generated for this enum. | 22 // A Java counterpart will be generated for this enum. |
23 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser | 23 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser |
24 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ShortcutSource | 24 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ShortcutSource |
25 enum Source { | 25 enum Source { |
26 SOURCE_UNKNOWN = 0, | 26 SOURCE_UNKNOWN = 0, |
27 SOURCE_ADD_TO_HOMESCREEN_DEPRECATED = 1, | 27 SOURCE_ADD_TO_HOMESCREEN_DEPRECATED = 1, |
| 28 |
| 29 // Used for legacy PWAs added via the banner. |
28 SOURCE_APP_BANNER = 2, | 30 SOURCE_APP_BANNER = 2, |
29 SOURCE_BOOKMARK_NAVIGATOR_WIDGET = 3, | 31 SOURCE_BOOKMARK_NAVIGATOR_WIDGET = 3, |
30 SOURCE_BOOKMARK_SHORTCUT_WIDGET = 4, | 32 SOURCE_BOOKMARK_SHORTCUT_WIDGET = 4, |
| 33 |
| 34 // Used for legacy and WebAPKs launched from a notification. |
31 SOURCE_NOTIFICATION = 5, | 35 SOURCE_NOTIFICATION = 5, |
| 36 |
| 37 // Used for WebAPKs added via the menu item. |
32 SOURCE_ADD_TO_HOMESCREEN_PWA = 6, | 38 SOURCE_ADD_TO_HOMESCREEN_PWA = 6, |
| 39 |
| 40 // Used for legacy PWAs added via the menu item. |
33 SOURCE_ADD_TO_HOMESCREEN_STANDALONE = 7, | 41 SOURCE_ADD_TO_HOMESCREEN_STANDALONE = 7, |
| 42 |
| 43 // Used for bookmark-type shortcuts that launch the tabbed browser. |
34 SOURCE_ADD_TO_HOMESCREEN_SHORTCUT = 8, | 44 SOURCE_ADD_TO_HOMESCREEN_SHORTCUT = 8, |
| 45 |
| 46 // Used for WebAPKs launched via an external intent. |
35 SOURCE_EXTERNAL_INTENT = 9, | 47 SOURCE_EXTERNAL_INTENT = 9, |
36 SOURCE_COUNT = 10 | 48 |
| 49 // Used for WebAPK PWAs added via the banner. |
| 50 SOURCE_APP_BANNER_WEBAPK = 10, |
| 51 SOURCE_COUNT = 11 |
37 }; | 52 }; |
38 | 53 |
39 explicit ShortcutInfo(const GURL& shortcut_url); | 54 explicit ShortcutInfo(const GURL& shortcut_url); |
40 ShortcutInfo(const ShortcutInfo& other); | 55 ShortcutInfo(const ShortcutInfo& other); |
41 ~ShortcutInfo(); | 56 ~ShortcutInfo(); |
42 | 57 |
43 // Updates the info based on the given |manifest|. | 58 // Updates the info based on the given |manifest|. |
44 void UpdateFromManifest(const content::Manifest& manifest); | 59 void UpdateFromManifest(const content::Manifest& manifest); |
45 | 60 |
46 // Updates the source of the shortcut. | 61 // Updates the source of the shortcut. |
(...skipping 12 matching lines...) Expand all Loading... |
59 int64_t background_color; | 74 int64_t background_color; |
60 int ideal_splash_image_size_in_px; | 75 int ideal_splash_image_size_in_px; |
61 int minimum_splash_image_size_in_px; | 76 int minimum_splash_image_size_in_px; |
62 GURL splash_image_url; | 77 GURL splash_image_url; |
63 GURL best_primary_icon_url; | 78 GURL best_primary_icon_url; |
64 GURL best_badge_icon_url; | 79 GURL best_badge_icon_url; |
65 std::vector<std::string> icon_urls; | 80 std::vector<std::string> icon_urls; |
66 }; | 81 }; |
67 | 82 |
68 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_INFO_H_ | 83 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_INFO_H_ |
OLD | NEW |