| 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 17 matching lines...) Expand all Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |