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

Unified Diff: chrome/browser/android/shortcut_info.cc

Issue 2697473005: Improve the resolution of the menu item homescreen launch source metric. (Closed)
Patch Set: Nits Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/shortcut_info.cc
diff --git a/chrome/browser/android/shortcut_info.cc b/chrome/browser/android/shortcut_info.cc
index ebfe836114c5b38433ff14b347d6b7a1b90f896c..817d877dcc2be2a5164ab4e19a1ebc38958c46c9 100644
--- a/chrome/browser/android/shortcut_info.cc
+++ b/chrome/browser/android/shortcut_info.cc
@@ -8,10 +8,9 @@ ShortcutInfo::ShortcutInfo(const GURL& shortcut_url)
: url(shortcut_url),
display(blink::WebDisplayModeBrowser),
orientation(blink::WebScreenOrientationLockDefault),
- source(SOURCE_ADD_TO_HOMESCREEN),
+ source(SOURCE_ADD_TO_HOMESCREEN_SHORTCUT),
theme_color(content::Manifest::kInvalidOrMissingColor),
- background_color(content::Manifest::kInvalidOrMissingColor) {
-}
+ background_color(content::Manifest::kInvalidOrMissingColor) {}
ShortcutInfo::ShortcutInfo(const ShortcutInfo& other) = default;
@@ -42,10 +41,14 @@ void ShortcutInfo::UpdateFromManifest(const content::Manifest& manifest) {
if (manifest.display != blink::WebDisplayModeUndefined)
display = manifest.display;
- // 'minimal-ui' is not yet supported, so fallback in this case.
- // See crbug.com/604390.
- if (manifest.display == blink::WebDisplayModeMinimalUi)
+ // 'minimal-ui' is not yet supported (see crbug.com/604390). Otherwise, set
+ // the source to be standalone if appropriate.
+ if (manifest.display == blink::WebDisplayModeMinimalUi) {
display = blink::WebDisplayModeBrowser;
+ } else if (display == blink::WebDisplayModeStandalone ||
+ display == blink::WebDisplayModeFullscreen) {
+ source = SOURCE_ADD_TO_HOMESCREEN_STANDALONE;
+ }
// Set the orientation based on the manifest value, if any.
if (manifest.orientation != blink::WebScreenOrientationLockDefault) {
« no previous file with comments | « chrome/browser/android/shortcut_info.h ('k') | chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698