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

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

Issue 1176583003: Move EqualsASCII to the base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util2
Patch Set: Created 5 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 <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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 } // namespace 96 } // namespace
97 97
98 bool ParseIconSizes(const base::string16& text, 98 bool ParseIconSizes(const base::string16& text,
99 std::vector<gfx::Size>* sizes, 99 std::vector<gfx::Size>* sizes,
100 bool* is_any) { 100 bool* is_any) {
101 *is_any = false; 101 *is_any = false;
102 std::vector<base::string16> size_strings; 102 std::vector<base::string16> size_strings;
103 base::SplitStringAlongWhitespace(text, &size_strings); 103 base::SplitStringAlongWhitespace(text, &size_strings);
104 for (size_t i = 0; i < size_strings.size(); ++i) { 104 for (size_t i = 0; i < size_strings.size(); ++i) {
105 if (EqualsASCII(size_strings[i], "any")) { 105 if (base::EqualsASCII(size_strings[i], "any")) {
106 *is_any = true; 106 *is_any = true;
107 } else { 107 } else {
108 gfx::Size size = ParseIconSize(size_strings[i]); 108 gfx::Size size = ParseIconSize(size_strings[i]);
109 if (size.width() <= 0 || size.height() <= 0) 109 if (size.width() <= 0 || size.height() <= 0)
110 return false; // Bogus size. 110 return false; // Bogus size.
111 sizes->push_back(size); 111 sizes->push_back(size);
112 } 112 }
113 } 113 }
114 if (*is_any && !sizes->empty()) { 114 if (*is_any && !sizes->empty()) {
115 // If is_any is true, it must occur by itself. 115 // If is_any is true, it must occur by itself.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 base::LowerCaseEqualsASCII(content, "yes") && 179 base::LowerCaseEqualsASCII(content, "yes") &&
180 app_info->mobile_capable == 180 app_info->mobile_capable ==
181 WebApplicationInfo::MOBILE_CAPABLE_UNSPECIFIED) { 181 WebApplicationInfo::MOBILE_CAPABLE_UNSPECIFIED) {
182 app_info->mobile_capable = WebApplicationInfo::MOBILE_CAPABLE_APPLE; 182 app_info->mobile_capable = WebApplicationInfo::MOBILE_CAPABLE_APPLE;
183 } 183 }
184 } 184 }
185 } 185 }
186 } 186 }
187 187
188 } // namespace web_apps 188 } // namespace web_apps
OLDNEW
« no previous file with comments | « chrome/renderer/safe_browsing/phishing_classifier.cc ('k') | content/browser/accessibility/browser_accessibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698