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

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

Issue 2070433002: Use scope defined in Web Manifest when adding page to homescreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into webapk_scope Created 4 years, 5 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
« no previous file with comments | « chrome/browser/android/shortcut_info.h ('k') | content/common/manifest_manager_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/android/shortcut_info.h" 5 #include "chrome/browser/android/shortcut_info.h"
6 6
7 ShortcutInfo::ShortcutInfo(const GURL& shortcut_url) 7 ShortcutInfo::ShortcutInfo(const GURL& shortcut_url)
8 : url(shortcut_url), 8 : url(shortcut_url),
9 display(blink::WebDisplayModeBrowser), 9 display(blink::WebDisplayModeBrowser),
10 orientation(blink::WebScreenOrientationLockDefault), 10 orientation(blink::WebScreenOrientationLockDefault),
(...skipping 17 matching lines...) Expand all
28 short_name = name; 28 short_name = name;
29 else 29 else
30 name = short_name; 30 name = short_name;
31 } 31 }
32 user_title = short_name; 32 user_title = short_name;
33 33
34 // Set the url based on the manifest value, if any. 34 // Set the url based on the manifest value, if any.
35 if (manifest.start_url.is_valid()) 35 if (manifest.start_url.is_valid())
36 url = manifest.start_url; 36 url = manifest.start_url;
37 37
38 if (manifest.scope.is_valid())
39 scope = manifest.scope;
40
38 // Set the display based on the manifest value, if any. 41 // Set the display based on the manifest value, if any.
39 if (manifest.display != blink::WebDisplayModeUndefined) 42 if (manifest.display != blink::WebDisplayModeUndefined)
40 display = manifest.display; 43 display = manifest.display;
41 44
42 // 'minimal-ui' is not yet supported, so fallback in this case. 45 // 'minimal-ui' is not yet supported, so fallback in this case.
43 // See crbug.com/604390. 46 // See crbug.com/604390.
44 if (manifest.display == blink::WebDisplayModeMinimalUi) 47 if (manifest.display == blink::WebDisplayModeMinimalUi)
45 display = blink::WebDisplayModeBrowser; 48 display = blink::WebDisplayModeBrowser;
46 49
47 // Set the orientation based on the manifest value, if any. 50 // Set the orientation based on the manifest value, if any.
(...skipping 10 matching lines...) Expand all
58 theme_color = manifest.theme_color; 61 theme_color = manifest.theme_color;
59 62
60 // Set the background color based on the manifest value, if any. 63 // Set the background color based on the manifest value, if any.
61 if (manifest.background_color != content::Manifest::kInvalidOrMissingColor) 64 if (manifest.background_color != content::Manifest::kInvalidOrMissingColor)
62 background_color = manifest.background_color; 65 background_color = manifest.background_color;
63 } 66 }
64 67
65 void ShortcutInfo::UpdateSource(const Source new_source) { 68 void ShortcutInfo::UpdateSource(const Source new_source) {
66 source = new_source; 69 source = new_source;
67 } 70 }
OLDNEW
« no previous file with comments | « chrome/browser/android/shortcut_info.h ('k') | content/common/manifest_manager_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698