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

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

Issue 2050933002: Upstream: Add additional checks before creating a WebAPK after clicking "Add to Homescreen" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_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 "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 12 matching lines...) Expand all
23 enum Source { 23 enum Source {
24 SOURCE_UNKNOWN = 0, 24 SOURCE_UNKNOWN = 0,
25 SOURCE_ADD_TO_HOMESCREEN = 1, 25 SOURCE_ADD_TO_HOMESCREEN = 1,
26 SOURCE_APP_BANNER = 2, 26 SOURCE_APP_BANNER = 2,
27 SOURCE_BOOKMARK_NAVIGATOR_WIDGET = 3, 27 SOURCE_BOOKMARK_NAVIGATOR_WIDGET = 3,
28 SOURCE_BOOKMARK_SHORTCUT_WIDGET = 4, 28 SOURCE_BOOKMARK_SHORTCUT_WIDGET = 4,
29 SOURCE_NOTIFICATION = 5, 29 SOURCE_NOTIFICATION = 5,
30 SOURCE_COUNT = 6 30 SOURCE_COUNT = 6
31 }; 31 };
32 32
33 // The shortcut type.
34 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser
35 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ShortcutType
36 enum class Type {
37 // Dedicated APK should be created for the shortcut so that the shortcut is
38 // present in the app list and on the home screen. Shortcut opens Chrome in
39 // fullscreen.
40 WEBAPK,
41 // Shortcut is present on home screen but not in app list. Shortcut opens
42 // Chrome in fullscreen.
43 WEBAPP,
44 OTHER,
45 };
46
33 explicit ShortcutInfo(const GURL& shortcut_url); 47 explicit ShortcutInfo(const GURL& shortcut_url);
34 ShortcutInfo(const ShortcutInfo& other); 48 ShortcutInfo(const ShortcutInfo& other);
35 ~ShortcutInfo(); 49 ~ShortcutInfo();
36 50
37 // Updates the info based on the given |manifest|. 51 // Updates the info based on the given |manifest|.
38 void UpdateFromManifest(const content::Manifest& manifest); 52 void UpdateFromManifest(const content::Manifest& manifest);
39 53
40 // Updates the source of the shortcut. 54 // Updates the source of the shortcut.
41 void UpdateSource(const Source source); 55 void UpdateSource(const Source source);
42 56
43 GURL url; 57 GURL url;
44 base::string16 user_title; 58 base::string16 user_title;
45 base::string16 name; 59 base::string16 name;
46 base::string16 short_name; 60 base::string16 short_name;
47 blink::WebDisplayMode display; 61 blink::WebDisplayMode display;
48 blink::WebScreenOrientationLockType orientation; 62 blink::WebScreenOrientationLockType orientation;
49 Source source; 63 Source source;
50 int64_t theme_color; 64 int64_t theme_color;
51 int64_t background_color; 65 int64_t background_color;
52 bool is_icon_generated; 66 bool is_icon_generated;
67 Type type;
53 }; 68 };
54 69
55 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_INFO_H_ 70 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698