| 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 = 1, | 27 SOURCE_ADD_TO_HOMESCREEN_DEPRECATED = 1, |
| 28 SOURCE_APP_BANNER = 2, | 28 SOURCE_APP_BANNER = 2, |
| 29 SOURCE_BOOKMARK_NAVIGATOR_WIDGET = 3, | 29 SOURCE_BOOKMARK_NAVIGATOR_WIDGET = 3, |
| 30 SOURCE_BOOKMARK_SHORTCUT_WIDGET = 4, | 30 SOURCE_BOOKMARK_SHORTCUT_WIDGET = 4, |
| 31 SOURCE_NOTIFICATION = 5, | 31 SOURCE_NOTIFICATION = 5, |
| 32 SOURCE_COUNT = 6 | 32 SOURCE_ADD_TO_HOMESCREEN_PWA = 6, |
| 33 SOURCE_ADD_TO_HOMESCREEN_STANDALONE = 7, |
| 34 SOURCE_ADD_TO_HOMESCREEN_SHORTCUT = 8, |
| 35 SOURCE_COUNT = 9 |
| 33 }; | 36 }; |
| 34 | 37 |
| 35 explicit ShortcutInfo(const GURL& shortcut_url); | 38 explicit ShortcutInfo(const GURL& shortcut_url); |
| 36 ShortcutInfo(const ShortcutInfo& other); | 39 ShortcutInfo(const ShortcutInfo& other); |
| 37 ~ShortcutInfo(); | 40 ~ShortcutInfo(); |
| 38 | 41 |
| 39 // Updates the info based on the given |manifest|. | 42 // Updates the info based on the given |manifest|. |
| 40 void UpdateFromManifest(const content::Manifest& manifest); | 43 void UpdateFromManifest(const content::Manifest& manifest); |
| 41 | 44 |
| 42 // Updates the source of the shortcut. | 45 // Updates the source of the shortcut. |
| 43 void UpdateSource(const Source source); | 46 void UpdateSource(const Source source); |
| 44 | 47 |
| 45 GURL manifest_url; | 48 GURL manifest_url; |
| 46 GURL url; | 49 GURL url; |
| 47 GURL scope; | 50 GURL scope; |
| 48 base::string16 user_title; | 51 base::string16 user_title; |
| 49 base::string16 name; | 52 base::string16 name; |
| 50 base::string16 short_name; | 53 base::string16 short_name; |
| 51 blink::WebDisplayMode display; | 54 blink::WebDisplayMode display; |
| 52 blink::WebScreenOrientationLockType orientation; | 55 blink::WebScreenOrientationLockType orientation; |
| 53 Source source; | 56 Source source; |
| 54 int64_t theme_color; | 57 int64_t theme_color; |
| 55 int64_t background_color; | 58 int64_t background_color; |
| 56 GURL best_primary_icon_url; | 59 GURL best_primary_icon_url; |
| 57 GURL best_badge_icon_url; | 60 GURL best_badge_icon_url; |
| 58 std::vector<std::string> icon_urls; | 61 std::vector<std::string> icon_urls; |
| 59 }; | 62 }; |
| 60 | 63 |
| 61 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_INFO_H_ | 64 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_INFO_H_ |
| OLD | NEW |