| 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), |
| 11 source(SOURCE_ADD_TO_HOMESCREEN_SHORTCUT), | 11 source(SOURCE_ADD_TO_HOMESCREEN_SHORTCUT), |
| 12 theme_color(content::Manifest::kInvalidOrMissingColor), | 12 theme_color(content::Manifest::kInvalidOrMissingColor), |
| 13 background_color(content::Manifest::kInvalidOrMissingColor) {} | 13 background_color(content::Manifest::kInvalidOrMissingColor), |
| 14 ideal_splash_image_size_in_px(0), |
| 15 minimum_splash_image_size_in_px(0) {} |
| 14 | 16 |
| 15 ShortcutInfo::ShortcutInfo(const ShortcutInfo& other) = default; | 17 ShortcutInfo::ShortcutInfo(const ShortcutInfo& other) = default; |
| 16 | 18 |
| 17 ShortcutInfo::~ShortcutInfo() { | 19 ShortcutInfo::~ShortcutInfo() { |
| 18 } | 20 } |
| 19 | 21 |
| 20 void ShortcutInfo::UpdateFromManifest(const content::Manifest& manifest) { | 22 void ShortcutInfo::UpdateFromManifest(const content::Manifest& manifest) { |
| 21 if (!manifest.short_name.is_null()) | 23 if (!manifest.short_name.is_null()) |
| 22 short_name = manifest.short_name.string(); | 24 short_name = manifest.short_name.string(); |
| 23 if (!manifest.name.is_null()) | 25 if (!manifest.name.is_null()) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 73 |
| 72 // Set the icon urls based on the icons in the manifest, if any. | 74 // Set the icon urls based on the icons in the manifest, if any. |
| 73 icon_urls.clear(); | 75 icon_urls.clear(); |
| 74 for (const content::Manifest::Icon& icon : manifest.icons) | 76 for (const content::Manifest::Icon& icon : manifest.icons) |
| 75 icon_urls.push_back(icon.src.spec()); | 77 icon_urls.push_back(icon.src.spec()); |
| 76 } | 78 } |
| 77 | 79 |
| 78 void ShortcutInfo::UpdateSource(const Source new_source) { | 80 void ShortcutInfo::UpdateSource(const Source new_source) { |
| 79 source = new_source; | 81 source = new_source; |
| 80 } | 82 } |
| OLD | NEW |