| 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. |
| 44 // mode in those cases. | 44 // See crbug.com/604390. |
| 45 if (manifest.display == blink::WebDisplayModeFullscreen) | |
| 46 display = blink::WebDisplayModeStandalone; | |
| 47 if (manifest.display == blink::WebDisplayModeMinimalUi) | 45 if (manifest.display == blink::WebDisplayModeMinimalUi) |
| 48 display = blink::WebDisplayModeBrowser; | 46 display = blink::WebDisplayModeBrowser; |
| 49 | 47 |
| 50 // Set the orientation based on the manifest value, if any. | 48 // Set the orientation based on the manifest value, if any. |
| 51 if (manifest.orientation != blink::WebScreenOrientationLockDefault) { | 49 if (manifest.orientation != blink::WebScreenOrientationLockDefault) { |
| 52 // Ignore the orientation if the display mode is different from | 50 // Ignore the orientation if the display mode is different from |
| 53 // 'standalone'. | 51 // 'standalone'. |
| 54 // TODO(mlamouri): send a message to the developer console about this. | 52 // TODO(mlamouri): send a message to the developer console about this. |
| 55 if (display == blink::WebDisplayModeStandalone) | 53 if (display == blink::WebDisplayModeStandalone) |
| 56 orientation = manifest.orientation; | 54 orientation = manifest.orientation; |
| 57 } | 55 } |
| 58 | 56 |
| 59 // Set the theme color based on the manifest value, if any. | 57 // Set the theme color based on the manifest value, if any. |
| 60 if (manifest.theme_color != content::Manifest::kInvalidOrMissingColor) | 58 if (manifest.theme_color != content::Manifest::kInvalidOrMissingColor) |
| 61 theme_color = manifest.theme_color; | 59 theme_color = manifest.theme_color; |
| 62 | 60 |
| 63 // Set the background color based on the manifest value, if any. | 61 // Set the background color based on the manifest value, if any. |
| 64 if (manifest.background_color != content::Manifest::kInvalidOrMissingColor) | 62 if (manifest.background_color != content::Manifest::kInvalidOrMissingColor) |
| 65 background_color = manifest.background_color; | 63 background_color = manifest.background_color; |
| 66 } | 64 } |
| 67 | 65 |
| 68 void ShortcutInfo::UpdateSource(const Source new_source) { | 66 void ShortcutInfo::UpdateSource(const Source new_source) { |
| 69 source = new_source; | 67 source = new_source; |
| 70 } | 68 } |
| OLD | NEW |