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 "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "content/public/common/manifest.h" | 9 #include "content/public/common/manifest.h" |
10 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree nOrientationLockType.h" | 10 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree nOrientationLockType.h" |
11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
12 | 12 |
13 // Information needed to create a shortcut via ShortcutHelper. | 13 // Information needed to create a shortcut via ShortcutHelper. |
14 struct ShortcutInfo { | 14 struct ShortcutInfo { |
15 | 15 |
16 // This enum is used to back a UMA histogram, and must be treated as | 16 // This enum is used to back a UMA histogram, and must be treated as |
17 // append-only. | 17 // append-only. |
18 // A Java counterpart will be generated for this enum. | |
19 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser | |
newt (away)
2015/07/15 02:56:00
Source is a very generic name. Let's generate the
aurimas (slooooooooow)
2015/07/16 01:15:31
Done
aurimas (slooooooooow)
2015/07/16 01:15:31
Done
| |
18 enum Source { | 20 enum Source { |
19 SOURCE_UNKNOWN = 0, | 21 SOURCE_UNKNOWN = 0, |
20 SOURCE_ADD_TO_HOMESCREEN = 1, | 22 SOURCE_ADD_TO_HOMESCREEN = 1, |
21 SOURCE_APP_BANNER = 2, | 23 SOURCE_APP_BANNER = 2, |
22 SOURCE_COUNT = 3 | 24 SOURCE_BOOKMARK_NAVIGATOR_WIDGET = 3, |
25 SOURCE_BOOKMARK_SHORTCUT_WIDGET = 4, | |
26 SOURCE_COUNT = 5 | |
23 }; | 27 }; |
24 | 28 |
25 ShortcutInfo(); | 29 ShortcutInfo(); |
26 explicit ShortcutInfo(const GURL& shortcut_url); | 30 explicit ShortcutInfo(const GURL& shortcut_url); |
27 | 31 |
28 // Updates the info based on the given |manifest|. | 32 // Updates the info based on the given |manifest|. |
29 void UpdateFromManifest(const content::Manifest& manifest); | 33 void UpdateFromManifest(const content::Manifest& manifest); |
30 | 34 |
31 // Updates the source of the shortcut. | 35 // Updates the source of the shortcut. |
32 void UpdateSource(const Source source); | 36 void UpdateSource(const Source source); |
33 | 37 |
34 GURL url; | 38 GURL url; |
35 base::string16 title; | 39 base::string16 title; |
36 content::Manifest::DisplayMode display; | 40 content::Manifest::DisplayMode display; |
37 blink::WebScreenOrientationLockType orientation; | 41 blink::WebScreenOrientationLockType orientation; |
38 Source source; | 42 Source source; |
39 }; | 43 }; |
40 | 44 |
41 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_INFO_H_ | 45 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_INFO_H_ |
OLD | NEW |