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

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

Issue 2489233003: [extensions] Remove unnecessary checks in IsSensitiveURL (Closed)
Patch Set: more DomainIs 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
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 if (update_url == store_url) { 84 return (update_url.host_piece() == store_url.host_piece() &&
85 return true; 85 update_url.path_piece() == store_url.path_piece());
86 } else {
87 return (update_url.host() == store_url.host() &&
88 update_url.path() == store_url.path());
89 }
90 } 86 }
91 87
92 bool IsBlacklistUpdateUrl(const GURL& url) { 88 bool IsBlacklistUpdateUrl(const GURL& url) {
93 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get(); 89 extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get();
94 if (client) 90 if (client)
95 return client->IsBlacklistUpdateURL(url); 91 return client->IsBlacklistUpdateURL(url);
96 return false; 92 return false;
97 } 93 }
98 94
99 } // namespace extension_urls 95 } // namespace extension_urls
OLDNEW
« no previous file with comments | « extensions/browser/api/web_request/web_request_permissions_unittest.cc ('k') | extensions/test/test_extensions_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698