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

Side by Side Diff: chrome/renderer/web_apps.cc

Issue 2765083002: Hardcode extensions::util::IsNewBookmarkAppsEnabled() to true, except on Mac. (Closed)
Patch Set: remove logging Created 3 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/web_apps.h" 5 #include "chrome/renderer/web_apps.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/command_line.h" 12 #include "base/command_line.h"
dominickn 2017/03/22 04:18:12 #include "base/feature_list.h"
tapted 2017/03/23 02:59:58 Done.
13 #include "base/json/json_reader.h" 13 #include "base/json/json_reader.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/string_split.h" 16 #include "base/strings/string_split.h"
17 #include "base/strings/string_util.h" 17 #include "base/strings/string_util.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "base/values.h" 19 #include "base/values.h"
20 #include "build/build_config.h" 20 #include "build/build_config.h"
21 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_features.h"
22 #include "chrome/common/web_application_info.h" 22 #include "chrome/common/web_application_info.h"
23 #include "third_party/WebKit/public/platform/WebIconSizesParser.h" 23 #include "third_party/WebKit/public/platform/WebIconSizesParser.h"
24 #include "third_party/WebKit/public/platform/WebString.h" 24 #include "third_party/WebKit/public/platform/WebString.h"
25 #include "third_party/WebKit/public/platform/WebURL.h" 25 #include "third_party/WebKit/public/platform/WebURL.h"
26 #include "third_party/WebKit/public/web/WebDocument.h" 26 #include "third_party/WebKit/public/web/WebDocument.h"
27 #include "third_party/WebKit/public/web/WebElement.h" 27 #include "third_party/WebKit/public/web/WebElement.h"
28 #include "third_party/WebKit/public/web/WebFrame.h" 28 #include "third_party/WebKit/public/web/WebFrame.h"
29 #include "third_party/WebKit/public/web/WebNode.h" 29 #include "third_party/WebKit/public/web/WebNode.h"
30 #include "ui/gfx/geometry/size.h" 30 #include "ui/gfx/geometry/size.h"
31 #include "url/gurl.h" 31 #include "url/gurl.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 if (elem.hasHTMLTagName("link")) { 143 if (elem.hasHTMLTagName("link")) {
144 std::string rel = elem.getAttribute("rel").utf8(); 144 std::string rel = elem.getAttribute("rel").utf8();
145 // "rel" attribute may use either "icon" or "shortcut icon". 145 // "rel" attribute may use either "icon" or "shortcut icon".
146 // see also 146 // see also
147 // <http://en.wikipedia.org/wiki/Favicon> 147 // <http://en.wikipedia.org/wiki/Favicon>
148 // <http://dev.w3.org/html5/spec/Overview.html#rel-icon> 148 // <http://dev.w3.org/html5/spec/Overview.html#rel-icon>
149 // 149 //
150 // Bookmark apps also support "apple-touch-icon" and 150 // Bookmark apps also support "apple-touch-icon" and
151 // "apple-touch-icon-precomposed". 151 // "apple-touch-icon-precomposed".
152 #if defined(OS_MACOSX) 152 #if defined(OS_MACOSX)
153 bool bookmark_apps_enabled = base::CommandLine::ForCurrentProcess()-> 153 bool bookmark_apps_enabled =
154 HasSwitch(switches::kEnableNewBookmarkApps); 154 base::FeatureList::IsEnabled(features::kBookmarkApps);
155 #else 155 #else
156 bool bookmark_apps_enabled = !base::CommandLine::ForCurrentProcess()-> 156 bool bookmark_apps_enabled = true;
157 HasSwitch(switches::kDisableNewBookmarkApps);
158 #endif 157 #endif
159 if (base::LowerCaseEqualsASCII(rel, "icon") || 158 if (base::LowerCaseEqualsASCII(rel, "icon") ||
160 base::LowerCaseEqualsASCII(rel, "shortcut icon") || 159 base::LowerCaseEqualsASCII(rel, "shortcut icon") ||
161 (bookmark_apps_enabled && 160 (bookmark_apps_enabled &&
162 (base::LowerCaseEqualsASCII(rel, "apple-touch-icon") || 161 (base::LowerCaseEqualsASCII(rel, "apple-touch-icon") ||
163 base::LowerCaseEqualsASCII(rel, "apple-touch-icon-precomposed")))) { 162 base::LowerCaseEqualsASCII(rel, "apple-touch-icon-precomposed")))) {
164 AddInstallIcon(elem, &app_info->icons); 163 AddInstallIcon(elem, &app_info->icons);
165 } 164 }
166 } else if (elem.hasHTMLTagName("meta") && elem.hasAttribute("name")) { 165 } else if (elem.hasHTMLTagName("meta") && elem.hasAttribute("name")) {
167 std::string name = elem.getAttribute("name").utf8(); 166 std::string name = elem.getAttribute("name").utf8();
(...skipping 15 matching lines...) Expand all
183 base::LowerCaseEqualsASCII(content.utf16(), "yes") && 182 base::LowerCaseEqualsASCII(content.utf16(), "yes") &&
184 app_info->mobile_capable == 183 app_info->mobile_capable ==
185 WebApplicationInfo::MOBILE_CAPABLE_UNSPECIFIED) { 184 WebApplicationInfo::MOBILE_CAPABLE_UNSPECIFIED) {
186 app_info->mobile_capable = WebApplicationInfo::MOBILE_CAPABLE_APPLE; 185 app_info->mobile_capable = WebApplicationInfo::MOBILE_CAPABLE_APPLE;
187 } 186 }
188 } 187 }
189 } 188 }
190 } 189 }
191 190
192 } // namespace web_apps 191 } // namespace web_apps
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698