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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_helper.cc

Issue 2950803002: Use ContainsValue() instead of std::find() in chrome/browser/ and chrome/test/ (Closed)
Patch Set: Reverted code for file thumbnail_cache.cc 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/browser/browsing_data/browsing_data_helper.h" 5 #include "chrome/browser/browsing_data/browsing_data_helper.h"
6 6
7 #include <algorithm>
8 #include <vector> 7 #include <vector>
9 8
9 #include "base/stl_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "extensions/common/constants.h" 11 #include "extensions/common/constants.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 #include "url/url_util.h" 13 #include "url/url_util.h"
14 14
15 // Static 15 // Static
16 bool BrowsingDataHelper::IsWebScheme(const std::string& scheme) { 16 bool BrowsingDataHelper::IsWebScheme(const std::string& scheme) {
17 const std::vector<std::string>& schemes = url::GetWebStorageSchemes(); 17 const std::vector<std::string>& schemes = url::GetWebStorageSchemes();
18 return std::find(schemes.begin(), schemes.end(), scheme) != schemes.end(); 18 return base::ContainsValue(schemes, scheme);
19 } 19 }
20 20
21 // Static 21 // Static
22 bool BrowsingDataHelper::HasWebScheme(const GURL& origin) { 22 bool BrowsingDataHelper::HasWebScheme(const GURL& origin) {
23 return BrowsingDataHelper::IsWebScheme(origin.scheme()); 23 return BrowsingDataHelper::IsWebScheme(origin.scheme());
24 } 24 }
25 25
26 // Static 26 // Static
27 bool BrowsingDataHelper::IsExtensionScheme(const std::string& scheme) { 27 bool BrowsingDataHelper::IsExtensionScheme(const std::string& scheme) {
28 return scheme == extensions::kExtensionScheme; 28 return scheme == extensions::kExtensionScheme;
29 } 29 }
30 30
31 // Static 31 // Static
32 bool BrowsingDataHelper::HasExtensionScheme(const GURL& origin) { 32 bool BrowsingDataHelper::HasExtensionScheme(const GURL& origin) {
33 return BrowsingDataHelper::IsExtensionScheme(origin.scheme()); 33 return BrowsingDataHelper::IsExtensionScheme(origin.scheme());
34 } 34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698