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

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

Issue 2944283002: Replace --add-to-shelf flag with kAppBanners feature. (Closed)
Patch Set: Double Doh! Created 3 years, 6 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>
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 if (elem.HasHTMLTagName("link")) { 144 if (elem.HasHTMLTagName("link")) {
145 std::string rel = elem.GetAttribute("rel").Utf8(); 145 std::string rel = elem.GetAttribute("rel").Utf8();
146 // "rel" attribute may use either "icon" or "shortcut icon". 146 // "rel" attribute may use either "icon" or "shortcut icon".
147 // see also 147 // see also
148 // <http://en.wikipedia.org/wiki/Favicon> 148 // <http://en.wikipedia.org/wiki/Favicon>
149 // <http://dev.w3.org/html5/spec/Overview.html#rel-icon> 149 // <http://dev.w3.org/html5/spec/Overview.html#rel-icon>
150 // 150 //
151 // Bookmark apps also support "apple-touch-icon" and 151 // Bookmark apps also support "apple-touch-icon" and
152 // "apple-touch-icon-precomposed". 152 // "apple-touch-icon-precomposed".
153 #if defined(OS_MACOSX) 153 #if defined(OS_MACOSX)
Lei Zhang 2017/06/22 07:21:05 Side question 2: This looks just like IsNewBookmar
benwells 2017/06/22 07:34:10 Good question. Currently IsNewBookmarkAppsEnabled
154 bool bookmark_apps_enabled = 154 bool bookmark_apps_enabled =
Lei Zhang 2017/06/22 07:21:05 Side question 1: Can we move this out of the for-l
155 base::FeatureList::IsEnabled(features::kBookmarkApps); 155 base::FeatureList::IsEnabled(features::kBookmarkApps) ||
156 base::FeatureList::IsEnabled(features::kAppBanners);
156 #else 157 #else
157 bool bookmark_apps_enabled = true; 158 bool bookmark_apps_enabled = true;
158 #endif 159 #endif
159 if (base::LowerCaseEqualsASCII(rel, "icon") || 160 if (base::LowerCaseEqualsASCII(rel, "icon") ||
160 base::LowerCaseEqualsASCII(rel, "shortcut icon") || 161 base::LowerCaseEqualsASCII(rel, "shortcut icon") ||
161 (bookmark_apps_enabled && 162 (bookmark_apps_enabled &&
162 (base::LowerCaseEqualsASCII(rel, "apple-touch-icon") || 163 (base::LowerCaseEqualsASCII(rel, "apple-touch-icon") ||
163 base::LowerCaseEqualsASCII(rel, "apple-touch-icon-precomposed")))) { 164 base::LowerCaseEqualsASCII(rel, "apple-touch-icon-precomposed")))) {
164 AddInstallIcon(elem, &app_info->icons); 165 AddInstallIcon(elem, &app_info->icons);
165 } 166 }
(...skipping 17 matching lines...) Expand all
183 base::LowerCaseEqualsASCII(content.Utf16(), "yes") && 184 base::LowerCaseEqualsASCII(content.Utf16(), "yes") &&
184 app_info->mobile_capable == 185 app_info->mobile_capable ==
185 WebApplicationInfo::MOBILE_CAPABLE_UNSPECIFIED) { 186 WebApplicationInfo::MOBILE_CAPABLE_UNSPECIFIED) {
186 app_info->mobile_capable = WebApplicationInfo::MOBILE_CAPABLE_APPLE; 187 app_info->mobile_capable = WebApplicationInfo::MOBILE_CAPABLE_APPLE;
187 } 188 }
188 } 189 }
189 } 190 }
190 } 191 }
191 192
192 } // namespace web_apps 193 } // namespace web_apps
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698