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 StartsWith(source, | 23 base::StartsWith(source, base::ASCIIToUTF16("extensions::"), |
24 base::ASCIIToUTF16("extensions::"), | 24 true /* case-sensitive */); |
25 true /* case-sensitive */); | |
26 } | 25 } |
27 | 26 |
28 } // namespace extensions | 27 } // namespace extensions |
29 | 28 |
30 namespace extension_urls { | 29 namespace extension_urls { |
31 | 30 |
32 const char kChromeWebstoreBaseURL[] = "https://chrome.google.com/webstore"; | 31 const char kChromeWebstoreBaseURL[] = "https://chrome.google.com/webstore"; |
33 const char kChromeWebstoreUpdateURL[] = | 32 const char kChromeWebstoreUpdateURL[] = |
34 "https://clients2.google.com/service/update2/crx"; | 33 "https://clients2.google.com/service/update2/crx"; |
35 | 34 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 86 } |
88 | 87 |
89 bool IsBlacklistUpdateUrl(const GURL& url) { | 88 bool IsBlacklistUpdateUrl(const GURL& url) { |
90 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get(); | 89 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get(); |
91 if (client) | 90 if (client) |
92 return client->IsBlacklistUpdateURL(url); | 91 return client->IsBlacklistUpdateURL(url); |
93 return false; | 92 return false; |
94 } | 93 } |
95 | 94 |
96 } // namespace extension_urls | 95 } // namespace extension_urls |
OLD | NEW |