| 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" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 net::EscapeQueryParamValue(query, false)); | 65 net::EscapeQueryParamValue(query, false)); |
| 66 } | 66 } |
| 67 | 67 |
| 68 GURL GetWebstoreUpdateUrl() { | 68 GURL GetWebstoreUpdateUrl() { |
| 69 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get(); | 69 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get(); |
| 70 if (client) | 70 if (client) |
| 71 return GURL(client->GetWebstoreUpdateURL()); | 71 return GURL(client->GetWebstoreUpdateURL()); |
| 72 return GURL(kChromeWebstoreUpdateURL); | 72 return GURL(kChromeWebstoreUpdateURL); |
| 73 } | 73 } |
| 74 | 74 |
| 75 GURL GetWebstoreReportAbuseUrl(const std::string& extension_id) { |
| 76 return GURL(GetWebstoreLaunchURL() + "/report/" + extension_id); |
| 77 } |
| 78 |
| 75 bool IsWebstoreUpdateUrl(const GURL& update_url) { | 79 bool IsWebstoreUpdateUrl(const GURL& update_url) { |
| 76 GURL store_url = GetWebstoreUpdateUrl(); | 80 GURL store_url = GetWebstoreUpdateUrl(); |
| 77 if (update_url == store_url) { | 81 if (update_url == store_url) { |
| 78 return true; | 82 return true; |
| 79 } else { | 83 } else { |
| 80 return (update_url.host() == store_url.host() && | 84 return (update_url.host() == store_url.host() && |
| 81 update_url.path() == store_url.path()); | 85 update_url.path() == store_url.path()); |
| 82 } | 86 } |
| 83 } | 87 } |
| 84 | 88 |
| 85 bool IsBlacklistUpdateUrl(const GURL& url) { | 89 bool IsBlacklistUpdateUrl(const GURL& url) { |
| 86 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get(); | 90 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get(); |
| 87 if (client) | 91 if (client) |
| 88 return client->IsBlacklistUpdateURL(url); | 92 return client->IsBlacklistUpdateURL(url); |
| 89 return false; | 93 return false; |
| 90 } | 94 } |
| 91 | 95 |
| 92 } // namespace extension_urls | 96 } // namespace extension_urls |
| OLD | NEW |