Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: extensions/common/extension_urls.cc

Issue 2493053002: [extensions] Stop parsing webstore urls so much (Closed)
Patch Set: rdevlin review Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/extensions/extension_constants.cc ('k') | extensions/common/extensions_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 GURL GetWebstoreSearchPageUrl(const std::string& query) { 63 GURL GetWebstoreSearchPageUrl(const std::string& query) {
64 return GURL(GetWebstoreLaunchURL() + "/search/" + 64 return GURL(GetWebstoreLaunchURL() + "/search/" +
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 client->GetWebstoreUpdateURL();
72 return GURL(kChromeWebstoreUpdateURL); 72 return GURL(kChromeWebstoreUpdateURL);
73 } 73 }
74 74
75 GURL GetWebstoreReportAbuseUrl(const std::string& extension_id, 75 GURL GetWebstoreReportAbuseUrl(const std::string& extension_id,
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 return (update_url.host_piece() == store_url.host_piece() && 84 return (update_url.host_piece() == store_url.host_piece() &&
85 update_url.path_piece() == store_url.path_piece()); 85 update_url.path_piece() == store_url.path_piece());
86 } 86 }
87 87
88 bool IsBlacklistUpdateUrl(const GURL& url) { 88 bool IsBlacklistUpdateUrl(const GURL& url) {
89 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get(); 89 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get();
90 if (client) 90 if (client)
91 return client->IsBlacklistUpdateURL(url); 91 return client->IsBlacklistUpdateURL(url);
92 return false; 92 return false;
93 } 93 }
94 94
95 } // namespace extension_urls 95 } // namespace extension_urls
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_constants.cc ('k') | extensions/common/extensions_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698