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" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 const char kExtensionBlocklistUrlPrefix[] = | 54 const char kExtensionBlocklistUrlPrefix[] = |
55 "http://www.gstatic.com/chrome/extensions/blacklist"; | 55 "http://www.gstatic.com/chrome/extensions/blacklist"; |
56 const char kExtensionBlocklistHttpsUrlPrefix[] = | 56 const char kExtensionBlocklistHttpsUrlPrefix[] = |
57 "https://www.gstatic.com/chrome/extensions/blacklist"; | 57 "https://www.gstatic.com/chrome/extensions/blacklist"; |
58 | 58 |
59 GURL GetWebstoreUpdateUrl() { | 59 GURL GetWebstoreUpdateUrl() { |
60 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 60 CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
61 if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL)) | 61 if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL)) |
62 return GURL(cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL)); | 62 return GURL(cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL)); |
63 else | 63 else |
64 return GURL(kGalleryUpdateHttpsUrl); | 64 return GetDefaultWebstoreUpdateUrl(); |
| 65 } |
| 66 |
| 67 GURL GetDefaultWebstoreUpdateUrl() { |
| 68 return GURL(kGalleryUpdateHttpsUrl); |
65 } | 69 } |
66 | 70 |
67 bool IsWebstoreUpdateUrl(const GURL& update_url) { | 71 bool IsWebstoreUpdateUrl(const GURL& update_url) { |
68 GURL store_url = GetWebstoreUpdateUrl(); | 72 GURL store_url = GetWebstoreUpdateUrl(); |
69 if (update_url == store_url) { | 73 if (update_url == store_url) { |
70 return true; | 74 return true; |
71 } else { | 75 } else { |
72 return (update_url.host() == store_url.host() && | 76 return (update_url.host() == store_url.host() && |
73 update_url.path() == store_url.path()); | 77 update_url.path() == store_url.path()); |
74 } | 78 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 0xfc, 0xf3, 0x08, 0x12, 0xff, 0x93, 0xbd, 0x62, 0x31, 0xd8, 0x1c, 0xea, | 194 0xfc, 0xf3, 0x08, 0x12, 0xff, 0x93, 0xbd, 0x62, 0x31, 0xd8, 0x1c, 0xea, |
191 0x1a, 0x9e, 0xf5, 0x81, 0x28, 0x7f, 0x75, 0x5e, 0xd2, 0x27, 0x7a, 0xc2, | 195 0x1a, 0x9e, 0xf5, 0x81, 0x28, 0x7f, 0x75, 0x5e, 0xd2, 0x27, 0x7a, 0xc2, |
192 0x96, 0xf5, 0x9d, 0xdb, 0x18, 0xfc, 0x76, 0xdc, 0x46, 0xf0, 0x57, 0xc0, | 196 0x96, 0xf5, 0x9d, 0xdb, 0x18, 0xfc, 0x76, 0xdc, 0x46, 0xf0, 0x57, 0xc0, |
193 0x58, 0x34, 0xc8, 0x22, 0x2d, 0x2a, 0x65, 0x75, 0xa7, 0xd9, 0x08, 0x62, | 197 0x58, 0x34, 0xc8, 0x22, 0x2d, 0x2a, 0x65, 0x75, 0xa7, 0xd9, 0x08, 0x62, |
194 0xcd, 0x02, 0x03, 0x01, 0x00, 0x01}; | 198 0xcd, 0x02, 0x03, 0x01, 0x00, 0x01}; |
195 | 199 |
196 const int kWebstoreSignaturesPublicKeySize = | 200 const int kWebstoreSignaturesPublicKeySize = |
197 arraysize(kWebstoreSignaturesPublicKey); | 201 arraysize(kWebstoreSignaturesPublicKey); |
198 | 202 |
199 } // namespace extension_misc | 203 } // namespace extension_misc |
OLD | NEW |