Chromium Code Reviews| 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/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "extensions/common/constants.h" | 10 #include "extensions/common/constants.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 const std::string& referrer_id) { | 76 const std::string& referrer_id) { |
| 77 return GURL(base::StringPrintf("%s/report/%s?utm_source=%s", | 77 return GURL(base::StringPrintf("%s/report/%s?utm_source=%s", |
| 78 GetWebstoreLaunchURL().c_str(), | 78 GetWebstoreLaunchURL().c_str(), |
| 79 extension_id.c_str(), referrer_id.c_str())); | 79 extension_id.c_str(), referrer_id.c_str())); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool IsWebstoreUpdateUrl(const GURL& update_url) { | 82 bool IsWebstoreUpdateUrl(const GURL& update_url) { |
| 83 GURL store_url = GetWebstoreUpdateUrl(); | 83 GURL store_url = GetWebstoreUpdateUrl(); |
| 84 if (update_url == store_url) { | 84 if (update_url == store_url) { |
| 85 return true; | 85 return true; |
| 86 } else { | 86 } else { |
|
Devlin
2016/11/08 15:55:49
Totally not your code, but since you're here... :)
Charlie Harrison
2016/11/08 16:00:55
No problem. Done!
| |
| 87 return (update_url.host() == store_url.host() && | 87 return (update_url.host_piece() == store_url.host_piece() && |
| 88 update_url.path() == store_url.path()); | 88 update_url.path_piece() == store_url.path_piece()); |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool IsBlacklistUpdateUrl(const GURL& url) { | 92 bool IsBlacklistUpdateUrl(const GURL& url) { |
| 93 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get(); | 93 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get(); |
| 94 if (client) | 94 if (client) |
| 95 return client->IsBlacklistUpdateURL(url); | 95 return client->IsBlacklistUpdateURL(url); |
| 96 return false; | 96 return false; |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace extension_urls | 99 } // namespace extension_urls |
| OLD | NEW |