OLD | NEW |
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 continue; | 136 continue; |
137 WebElement elem = child.to<WebElement>(); | 137 WebElement elem = child.to<WebElement>(); |
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 // Streamlined Hosted 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 (LowerCaseEqualsASCII(rel, "icon") || | 148 if (LowerCaseEqualsASCII(rel, "icon") || |
149 LowerCaseEqualsASCII(rel, "shortcut icon") || | 149 LowerCaseEqualsASCII(rel, "shortcut icon") || |
150 (base::CommandLine::ForCurrentProcess()->HasSwitch( | 150 (base::CommandLine::ForCurrentProcess()->HasSwitch( |
151 switches::kEnableNewBookmarkApps) && | 151 switches::kEnableNewBookmarkApps) && |
152 (LowerCaseEqualsASCII(rel, "apple-touch-icon") || | 152 (LowerCaseEqualsASCII(rel, "apple-touch-icon") || |
153 LowerCaseEqualsASCII(rel, "apple-touch-icon-precomposed")))) { | 153 LowerCaseEqualsASCII(rel, "apple-touch-icon-precomposed")))) { |
154 AddInstallIcon(elem, &app_info->icons); | 154 AddInstallIcon(elem, &app_info->icons); |
155 } | 155 } |
156 } else if (elem.hasHTMLTagName("meta") && elem.hasAttribute("name")) { | 156 } else if (elem.hasHTMLTagName("meta") && elem.hasAttribute("name")) { |
(...skipping 16 matching lines...) Expand all Loading... |
173 LowerCaseEqualsASCII(content, "yes") && | 173 LowerCaseEqualsASCII(content, "yes") && |
174 app_info->mobile_capable == | 174 app_info->mobile_capable == |
175 WebApplicationInfo::MOBILE_CAPABLE_UNSPECIFIED) { | 175 WebApplicationInfo::MOBILE_CAPABLE_UNSPECIFIED) { |
176 app_info->mobile_capable = WebApplicationInfo::MOBILE_CAPABLE_APPLE; | 176 app_info->mobile_capable = WebApplicationInfo::MOBILE_CAPABLE_APPLE; |
177 } | 177 } |
178 } | 178 } |
179 } | 179 } |
180 } | 180 } |
181 | 181 |
182 } // namespace web_apps | 182 } // namespace web_apps |
OLD | NEW |