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

Side by Side Diff: extensions/common/extension_urls.cc

Issue 1220653002: Fix some case-insensitive cases for StartsWith (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: grt's review comments, Mac fix Created 5 years, 5 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 | « content/common/plugin_list_mac.mm ('k') | net/base/net_util.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/common/extension_urls.h" 5 #include "extensions/common/extension_urls.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "extensions/common/constants.h" 9 #include "extensions/common/constants.h"
10 #include "extensions/common/extensions_client.h" 10 #include "extensions/common/extensions_client.h"
11 #include "net/base/escape.h" 11 #include "net/base/escape.h"
12 #include "net/base/url_util.h" 12 #include "net/base/url_util.h"
13 #include "url/gurl.h" 13 #include "url/gurl.h"
14 14
15 namespace extensions { 15 namespace extensions {
16 16
17 const char kEventBindings[] = "event_bindings"; 17 const char kEventBindings[] = "event_bindings";
18 18
19 const char kSchemaUtils[] = "schemaUtils"; 19 const char kSchemaUtils[] = "schemaUtils";
20 20
21 bool IsSourceFromAnExtension(const base::string16& source) { 21 bool IsSourceFromAnExtension(const base::string16& source) {
22 return GURL(source).SchemeIs(kExtensionScheme) || 22 return GURL(source).SchemeIs(kExtensionScheme) ||
23 base::StartsWith(source, base::ASCIIToUTF16("extensions::"), 23 base::StartsWith(source, base::ASCIIToUTF16("extensions::"),
24 true /* case-sensitive */); 24 base::CompareCase::SENSITIVE);
25 } 25 }
26 26
27 } // namespace extensions 27 } // namespace extensions
28 28
29 namespace extension_urls { 29 namespace extension_urls {
30 30
31 const char kChromeWebstoreBaseURL[] = "https://chrome.google.com/webstore"; 31 const char kChromeWebstoreBaseURL[] = "https://chrome.google.com/webstore";
32 const char kChromeWebstoreUpdateURL[] = 32 const char kChromeWebstoreUpdateURL[] =
33 "https://clients2.google.com/service/update2/crx"; 33 "https://clients2.google.com/service/update2/crx";
34 34
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 } 86 }
87 87
88 bool IsBlacklistUpdateUrl(const GURL& url) { 88 bool IsBlacklistUpdateUrl(const GURL& url) {
89 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get(); 89 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get();
90 if (client) 90 if (client)
91 return client->IsBlacklistUpdateURL(url); 91 return client->IsBlacklistUpdateURL(url);
92 return false; 92 return false;
93 } 93 }
94 94
95 } // namespace extension_urls 95 } // namespace extension_urls
OLDNEW
« no previous file with comments | « content/common/plugin_list_mac.mm ('k') | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698