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

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

Issue 938603002: Disable bookmark apps on non-ChromeOS platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback Created 5 years, 10 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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 if (elem.hasHTMLTagName("link")) { 139 if (elem.hasHTMLTagName("link")) {
140 std::string rel = elem.getAttribute("rel").utf8(); 140 std::string rel = elem.getAttribute("rel").utf8();
141 // "rel" attribute may use either "icon" or "shortcut icon". 141 // "rel" attribute may use either "icon" or "shortcut icon".
142 // see also 142 // see also
143 // <http://en.wikipedia.org/wiki/Favicon> 143 // <http://en.wikipedia.org/wiki/Favicon>
144 // <http://dev.w3.org/html5/spec/Overview.html#rel-icon> 144 // <http://dev.w3.org/html5/spec/Overview.html#rel-icon>
145 // 145 //
146 // Bookmark apps also support "apple-touch-icon" and 146 // Bookmark apps also support "apple-touch-icon" and
147 // "apple-touch-icon-precomposed". 147 // "apple-touch-icon-precomposed".
148 #if defined(OS_CHROMEOS)
149 bool bookmark_apps_enabled = !base::CommandLine::ForCurrentProcess()->
150 HasSwitch(switches::kDisableNewBookmarkApps);
151 #else
152 bool bookmark_apps_enabled = base::CommandLine::ForCurrentProcess()->
153 HasSwitch(switches::kEnableNewBookmarkApps);
154 #endif
148 if (LowerCaseEqualsASCII(rel, "icon") || 155 if (LowerCaseEqualsASCII(rel, "icon") ||
149 LowerCaseEqualsASCII(rel, "shortcut icon") || 156 LowerCaseEqualsASCII(rel, "shortcut icon") ||
150 (!base::CommandLine::ForCurrentProcess()->HasSwitch( 157 (bookmark_apps_enabled &&
151 switches::kDisableNewBookmarkApps) &&
152 (LowerCaseEqualsASCII(rel, "apple-touch-icon") || 158 (LowerCaseEqualsASCII(rel, "apple-touch-icon") ||
153 LowerCaseEqualsASCII(rel, "apple-touch-icon-precomposed")))) { 159 LowerCaseEqualsASCII(rel, "apple-touch-icon-precomposed")))) {
154 AddInstallIcon(elem, &app_info->icons); 160 AddInstallIcon(elem, &app_info->icons);
155 } 161 }
156 } else if (elem.hasHTMLTagName("meta") && elem.hasAttribute("name")) { 162 } else if (elem.hasHTMLTagName("meta") && elem.hasAttribute("name")) {
157 std::string name = elem.getAttribute("name").utf8(); 163 std::string name = elem.getAttribute("name").utf8();
158 WebString content = elem.getAttribute("content"); 164 WebString content = elem.getAttribute("content");
159 if (name == "application-name") { 165 if (name == "application-name") {
160 app_info->title = content; 166 app_info->title = content;
161 } else if (name == "description") { 167 } else if (name == "description") {
(...skipping 11 matching lines...) Expand all
173 LowerCaseEqualsASCII(content, "yes") && 179 LowerCaseEqualsASCII(content, "yes") &&
174 app_info->mobile_capable == 180 app_info->mobile_capable ==
175 WebApplicationInfo::MOBILE_CAPABLE_UNSPECIFIED) { 181 WebApplicationInfo::MOBILE_CAPABLE_UNSPECIFIED) {
176 app_info->mobile_capable = WebApplicationInfo::MOBILE_CAPABLE_APPLE; 182 app_info->mobile_capable = WebApplicationInfo::MOBILE_CAPABLE_APPLE;
177 } 183 }
178 } 184 }
179 } 185 }
180 } 186 }
181 187
182 } // namespace web_apps 188 } // namespace web_apps
OLDNEW
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | chrome/test/data/extensions/api_test/management/test/launchType.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698