Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: chrome/browser/android/shortcut_info.cc

Issue 2050933002: Upstream: Add additional checks before creating a WebAPK after clicking "Add to Homescreen" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'create_webapk_requirements_enum_class' into create_webapk_requirements2 Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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), 11 source(SOURCE_ADD_TO_HOMESCREEN),
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 type(Type::OTHER) {
14 } 15 }
15 16
16 ShortcutInfo::ShortcutInfo(const ShortcutInfo& other) = default; 17 ShortcutInfo::ShortcutInfo(const ShortcutInfo& other) = default;
17 18
18 ShortcutInfo::~ShortcutInfo() { 19 ShortcutInfo::~ShortcutInfo() {
19 } 20 }
20 21
21 void ShortcutInfo::UpdateFromManifest(const content::Manifest& manifest) { 22 void ShortcutInfo::UpdateFromManifest(const content::Manifest& manifest) {
22 if (!manifest.short_name.is_null()) 23 if (!manifest.short_name.is_null())
23 short_name = manifest.short_name.string(); 24 short_name = manifest.short_name.string();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 theme_color = manifest.theme_color; 59 theme_color = manifest.theme_color;
59 60
60 // Set the background color based on the manifest value, if any. 61 // Set the background color based on the manifest value, if any.
61 if (manifest.background_color != content::Manifest::kInvalidOrMissingColor) 62 if (manifest.background_color != content::Manifest::kInvalidOrMissingColor)
62 background_color = manifest.background_color; 63 background_color = manifest.background_color;
63 } 64 }
64 65
65 void ShortcutInfo::UpdateSource(const Source new_source) { 66 void ShortcutInfo::UpdateSource(const Source new_source) {
66 source = new_source; 67 source = new_source;
67 } 68 }
OLDNEW
« no previous file with comments | « chrome/browser/android/shortcut_info.h ('k') | chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698