OLD | NEW |
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/common/extensions/extension_constants.h" | 5 #include "chrome/common/extensions/extension_constants.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
| 12 #include "extensions/common/extensions_client.h" |
12 #include "net/base/escape.h" | 13 #include "net/base/escape.h" |
13 #include "net/base/url_util.h" | 14 #include "net/base/url_util.h" |
14 | 15 |
15 namespace extension_urls { | 16 namespace extension_urls { |
16 | 17 |
17 std::string GetWebstoreLaunchURL() { | 18 std::string GetWebstoreLaunchURL() { |
18 std::string gallery_prefix = kGalleryBrowsePrefix; | 19 std::string gallery_prefix = kGalleryBrowsePrefix; |
19 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsGalleryURL)) | 20 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsGalleryURL)) |
20 gallery_prefix = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 21 gallery_prefix = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
21 switches::kAppsGalleryURL); | 22 switches::kAppsGalleryURL); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 const char kExtensionBlocklistUrlPrefix[] = | 55 const char kExtensionBlocklistUrlPrefix[] = |
55 "http://www.gstatic.com/chrome/extensions/blacklist"; | 56 "http://www.gstatic.com/chrome/extensions/blacklist"; |
56 const char kExtensionBlocklistHttpsUrlPrefix[] = | 57 const char kExtensionBlocklistHttpsUrlPrefix[] = |
57 "https://www.gstatic.com/chrome/extensions/blacklist"; | 58 "https://www.gstatic.com/chrome/extensions/blacklist"; |
58 | 59 |
59 GURL GetWebstoreUpdateUrl() { | 60 GURL GetWebstoreUpdateUrl() { |
60 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 61 CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
61 if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL)) | 62 if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL)) |
62 return GURL(cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL)); | 63 return GURL(cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL)); |
63 else | 64 else |
64 return GetDefaultWebstoreUpdateUrl(); | 65 return extension_urls::GetDefaultWebstoreUpdateUrl(); |
65 } | 66 } |
66 | 67 |
67 GURL GetDefaultWebstoreUpdateUrl() { | 68 GURL GetDefaultWebstoreUpdateUrl() { |
68 return GURL(kGalleryUpdateHttpsUrl); | 69 return GURL(kGalleryUpdateHttpsUrl); |
69 } | 70 } |
70 | 71 |
71 bool IsWebstoreUpdateUrl(const GURL& update_url) { | 72 bool IsWebstoreUpdateUrl(const GURL& update_url) { |
72 GURL store_url = GetWebstoreUpdateUrl(); | 73 GURL store_url = GetWebstoreUpdateUrl(); |
73 if (update_url == store_url) { | 74 if (update_url == store_url) { |
74 return true; | 75 return true; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 0xfc, 0xf3, 0x08, 0x12, 0xff, 0x93, 0xbd, 0x62, 0x31, 0xd8, 0x1c, 0xea, | 198 0xfc, 0xf3, 0x08, 0x12, 0xff, 0x93, 0xbd, 0x62, 0x31, 0xd8, 0x1c, 0xea, |
198 0x1a, 0x9e, 0xf5, 0x81, 0x28, 0x7f, 0x75, 0x5e, 0xd2, 0x27, 0x7a, 0xc2, | 199 0x1a, 0x9e, 0xf5, 0x81, 0x28, 0x7f, 0x75, 0x5e, 0xd2, 0x27, 0x7a, 0xc2, |
199 0x96, 0xf5, 0x9d, 0xdb, 0x18, 0xfc, 0x76, 0xdc, 0x46, 0xf0, 0x57, 0xc0, | 200 0x96, 0xf5, 0x9d, 0xdb, 0x18, 0xfc, 0x76, 0xdc, 0x46, 0xf0, 0x57, 0xc0, |
200 0x58, 0x34, 0xc8, 0x22, 0x2d, 0x2a, 0x65, 0x75, 0xa7, 0xd9, 0x08, 0x62, | 201 0x58, 0x34, 0xc8, 0x22, 0x2d, 0x2a, 0x65, 0x75, 0xa7, 0xd9, 0x08, 0x62, |
201 0xcd, 0x02, 0x03, 0x01, 0x00, 0x01}; | 202 0xcd, 0x02, 0x03, 0x01, 0x00, 0x01}; |
202 | 203 |
203 const int kWebstoreSignaturesPublicKeySize = | 204 const int kWebstoreSignaturesPublicKeySize = |
204 arraysize(kWebstoreSignaturesPublicKey); | 205 arraysize(kWebstoreSignaturesPublicKey); |
205 | 206 |
206 } // namespace extension_misc | 207 } // namespace extension_misc |
OLD | NEW |