| 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 scope(shortcut_url.GetOrigin()), | 9 scope(shortcut_url.GetOrigin()), |
| 10 display(blink::WebDisplayModeBrowser), | 10 display(blink::WebDisplayModeBrowser), |
| 11 orientation(blink::WebScreenOrientationLockDefault), | 11 orientation(blink::WebScreenOrientationLockDefault), |
| 12 source(SOURCE_ADD_TO_HOMESCREEN), | 12 source(SOURCE_ADD_TO_HOMESCREEN), |
| 13 theme_color(content::Manifest::kInvalidOrMissingColor), | 13 theme_color(content::Manifest::kInvalidOrMissingColor), |
| 14 background_color(content::Manifest::kInvalidOrMissingColor), | 14 background_color(content::Manifest::kInvalidOrMissingColor), |
| 15 is_icon_generated(false), | 15 is_icon_generated(false), |
| 16 is_web_apk(false) { | 16 is_webapk(false) { |
| 17 } | 17 } |
| 18 | 18 |
| 19 ShortcutInfo::ShortcutInfo(const ShortcutInfo& other) = default; | 19 ShortcutInfo::ShortcutInfo(const ShortcutInfo& other) = default; |
| 20 | 20 |
| 21 ShortcutInfo::~ShortcutInfo() { | 21 ShortcutInfo::~ShortcutInfo() { |
| 22 } | 22 } |
| 23 | 23 |
| 24 void ShortcutInfo::UpdateFromManifest(const content::Manifest& manifest) { | 24 void ShortcutInfo::UpdateFromManifest(const content::Manifest& manifest) { |
| 25 if (!manifest.short_name.is_null()) | 25 if (!manifest.short_name.is_null()) |
| 26 short_name = manifest.short_name.string(); | 26 short_name = manifest.short_name.string(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 theme_color = manifest.theme_color; | 67 theme_color = manifest.theme_color; |
| 68 | 68 |
| 69 // Set the background color based on the manifest value, if any. | 69 // Set the background color based on the manifest value, if any. |
| 70 if (manifest.background_color != content::Manifest::kInvalidOrMissingColor) | 70 if (manifest.background_color != content::Manifest::kInvalidOrMissingColor) |
| 71 background_color = manifest.background_color; | 71 background_color = manifest.background_color; |
| 72 } | 72 } |
| 73 | 73 |
| 74 void ShortcutInfo::UpdateSource(const Source new_source) { | 74 void ShortcutInfo::UpdateSource(const Source new_source) { |
| 75 source = new_source; | 75 source = new_source; |
| 76 } | 76 } |
| OLD | NEW |