OLD | NEW |
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 Loading... |
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 |
OLD | NEW |