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

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

Issue 1234653004: webapps: utilize manifest theme colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mounir's comments Created 5 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
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() 7 ShortcutInfo::ShortcutInfo()
8 : display(content::Manifest::DISPLAY_MODE_BROWSER), 8 : display(content::Manifest::DISPLAY_MODE_BROWSER),
9 orientation(blink::WebScreenOrientationLockDefault), 9 orientation(blink::WebScreenOrientationLockDefault),
10 source(SOURCE_ADD_TO_HOMESCREEN) { 10 source(SOURCE_ADD_TO_HOMESCREEN) {
(...skipping 13 matching lines...) Expand all
24 title = manifest.name.string(); 24 title = manifest.name.string();
25 25
26 // Set the url based on the manifest value, if any. 26 // Set the url based on the manifest value, if any.
27 if (manifest.start_url.is_valid()) 27 if (manifest.start_url.is_valid())
28 url = manifest.start_url; 28 url = manifest.start_url;
29 29
30 // Set the display based on the manifest value, if any. 30 // Set the display based on the manifest value, if any.
31 if (manifest.display != content::Manifest::DISPLAY_MODE_UNSPECIFIED) 31 if (manifest.display != content::Manifest::DISPLAY_MODE_UNSPECIFIED)
32 display = manifest.display; 32 display = manifest.display;
33 33
34 // Set the theme color based on the manifest value, if any
35 if (manifest.theme_color != -1)
mlamouri (slow - plz ping) 2015/07/17 13:28:29 ditto
36 theme_color = manifest.theme_color;
37
34 // 'fullscreen' and 'minimal-ui' are not yet supported, fallback to the right 38 // 'fullscreen' and 'minimal-ui' are not yet supported, fallback to the right
35 // mode in those cases. 39 // mode in those cases.
36 if (manifest.display == content::Manifest::DISPLAY_MODE_FULLSCREEN) 40 if (manifest.display == content::Manifest::DISPLAY_MODE_FULLSCREEN)
37 display = content::Manifest::DISPLAY_MODE_STANDALONE; 41 display = content::Manifest::DISPLAY_MODE_STANDALONE;
38 if (manifest.display == content::Manifest::DISPLAY_MODE_MINIMAL_UI) 42 if (manifest.display == content::Manifest::DISPLAY_MODE_MINIMAL_UI)
39 display = content::Manifest::DISPLAY_MODE_BROWSER; 43 display = content::Manifest::DISPLAY_MODE_BROWSER;
40 44
41 // Set the orientation based on the manifest value, if any. 45 // Set the orientation based on the manifest value, if any.
42 if (manifest.orientation != blink::WebScreenOrientationLockDefault) { 46 if (manifest.orientation != blink::WebScreenOrientationLockDefault) {
43 // Ignore the orientation if the display mode is different from 47 // Ignore the orientation if the display mode is different from
44 // 'standalone'. 48 // 'standalone'.
45 // TODO(mlamouri): send a message to the developer console about this. 49 // TODO(mlamouri): send a message to the developer console about this.
46 if (display == content::Manifest::DISPLAY_MODE_STANDALONE) 50 if (display == content::Manifest::DISPLAY_MODE_STANDALONE)
47 orientation = manifest.orientation; 51 orientation = manifest.orientation;
48 } 52 }
49 } 53 }
50 54
51 void ShortcutInfo::UpdateSource(const Source new_source) { 55 void ShortcutInfo::UpdateSource(const Source new_source) {
52 source = new_source; 56 source = new_source;
53 } 57 }
OLDNEW
« chrome/browser/android/shortcut_data_fetcher.cc ('K') | « chrome/browser/android/shortcut_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698