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

Side by Side Diff: chrome/browser/banners/app_banner_data_fetcher.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
« no previous file with comments | « base/strings/string_util.cc ('k') | chrome/browser/net/proxy_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/banners/app_banner_data_fetcher.h" 5 #include "chrome/browser/banners/app_banner_data_fetcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/banners/app_banner_debug_log.h" 10 #include "chrome/browser/banners/app_banner_debug_log.h"
(...skipping 17 matching lines...) Expand all
28 28
29 namespace { 29 namespace {
30 30
31 base::TimeDelta gTimeDeltaForTesting; 31 base::TimeDelta gTimeDeltaForTesting;
32 int gCurrentRequestID = -1; 32 int gCurrentRequestID = -1;
33 33
34 // The requirement for now is an image/png that is at least 144x144. 34 // The requirement for now is an image/png that is at least 144x144.
35 const int kIconMinimumSize = 144; 35 const int kIconMinimumSize = 144;
36 bool DoesManifestContainRequiredIcon(const content::Manifest& manifest) { 36 bool DoesManifestContainRequiredIcon(const content::Manifest& manifest) {
37 for (const auto& icon : manifest.icons) { 37 for (const auto& icon : manifest.icons) {
38 if (!EqualsASCII(icon.type.string(), "image/png")) 38 if (!base::EqualsASCII(icon.type.string(), "image/png"))
39 continue; 39 continue;
40 40
41 for (const auto& size : icon.sizes) { 41 for (const auto& size : icon.sizes) {
42 if (size.IsEmpty()) // "any" 42 if (size.IsEmpty()) // "any"
43 return true; 43 return true;
44 if (size.width() >= kIconMinimumSize && size.height() >= kIconMinimumSize) 44 if (size.width() >= kIconMinimumSize && size.height() >= kIconMinimumSize)
45 return true; 45 return true;
46 } 46 }
47 } 47 }
48 48
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 return false; 376 return false;
377 } 377 }
378 if (!DoesManifestContainRequiredIcon(manifest)) { 378 if (!DoesManifestContainRequiredIcon(manifest)) {
379 OutputDeveloperNotShownMessage(web_contents, kManifestMissingSuitableIcon); 379 OutputDeveloperNotShownMessage(web_contents, kManifestMissingSuitableIcon);
380 return false; 380 return false;
381 } 381 }
382 return true; 382 return true;
383 } 383 }
384 384
385 } // namespace banners 385 } // namespace banners
OLDNEW
« no previous file with comments | « base/strings/string_util.cc ('k') | chrome/browser/net/proxy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698