Chromium Code Reviews| 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 #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 22 matching lines...) Expand all Loading... | |
| 33 user_title = short_name; | 33 user_title = short_name; |
| 34 | 34 |
| 35 // Set the url based on the manifest value, if any. | 35 // Set the url based on the manifest value, if any. |
| 36 if (manifest.start_url.is_valid()) | 36 if (manifest.start_url.is_valid()) |
| 37 url = manifest.start_url; | 37 url = manifest.start_url; |
| 38 | 38 |
| 39 // Set the display based on the manifest value, if any. | 39 // Set the display based on the manifest value, if any. |
| 40 if (manifest.display != blink::WebDisplayModeUndefined) | 40 if (manifest.display != blink::WebDisplayModeUndefined) |
| 41 display = manifest.display; | 41 display = manifest.display; |
| 42 | 42 |
| 43 // 'fullscreen' and 'minimal-ui' are not yet supported, fallback to the right | 43 // 'minimal-ui' is not yet supported, so fallback in this case. |
|
mlamouri (slow - plz ping)
2016/05/11 10:18:57
Can you point to the minimal-ui BUG?
| |
| 44 // mode in those cases. | |
| 45 if (manifest.display == blink::WebDisplayModeFullscreen) | |
| 46 display = blink::WebDisplayModeStandalone; | |
| 47 if (manifest.display == blink::WebDisplayModeMinimalUi) | 44 if (manifest.display == blink::WebDisplayModeMinimalUi) |
| 48 display = blink::WebDisplayModeBrowser; | 45 display = blink::WebDisplayModeBrowser; |
| 49 | 46 |
| 50 // Set the orientation based on the manifest value, if any. | 47 // Set the orientation based on the manifest value, if any. |
| 51 if (manifest.orientation != blink::WebScreenOrientationLockDefault) { | 48 if (manifest.orientation != blink::WebScreenOrientationLockDefault) { |
| 52 // Ignore the orientation if the display mode is different from | 49 // Ignore the orientation if the display mode is different from |
| 53 // 'standalone'. | 50 // 'standalone'. |
| 54 // TODO(mlamouri): send a message to the developer console about this. | 51 // TODO(mlamouri): send a message to the developer console about this. |
| 55 if (display == blink::WebDisplayModeStandalone) | 52 if (display == blink::WebDisplayModeStandalone) |
| 56 orientation = manifest.orientation; | 53 orientation = manifest.orientation; |
| 57 } | 54 } |
| 58 | 55 |
| 59 // Set the theme color based on the manifest value, if any. | 56 // Set the theme color based on the manifest value, if any. |
| 60 if (manifest.theme_color != content::Manifest::kInvalidOrMissingColor) | 57 if (manifest.theme_color != content::Manifest::kInvalidOrMissingColor) |
| 61 theme_color = manifest.theme_color; | 58 theme_color = manifest.theme_color; |
| 62 | 59 |
| 63 // Set the background color based on the manifest value, if any. | 60 // Set the background color based on the manifest value, if any. |
| 64 if (manifest.background_color != content::Manifest::kInvalidOrMissingColor) | 61 if (manifest.background_color != content::Manifest::kInvalidOrMissingColor) |
| 65 background_color = manifest.background_color; | 62 background_color = manifest.background_color; |
| 66 } | 63 } |
| 67 | 64 |
| 68 void ShortcutInfo::UpdateSource(const Source new_source) { | 65 void ShortcutInfo::UpdateSource(const Source new_source) { |
| 69 source = new_source; | 66 source = new_source; |
| 70 } | 67 } |
| OLD | NEW |