diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-14 18:26:28 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-14 18:26:28 +0000 |
commit | 06f3754ff43b1f5460a558a2831b1a7f0badaf0d (patch) | |
tree | 20c9380249f0b537287a9d70c9858a05ca0084d1 | |
parent | f994f47b94bf160917e9638cd52cb5d2056739a7 (diff) | |
download | chromium_src-06f3754ff43b1f5460a558a2831b1a7f0badaf0d.zip chromium_src-06f3754ff43b1f5460a558a2831b1a7f0badaf0d.tar.gz chromium_src-06f3754ff43b1f5460a558a2831b1a7f0badaf0d.tar.bz2 |
Made IsGalleryDownloadURL() compare based on spec and made it a
static function.
BUG=52067
TEST=none
Review URL: http://codereview.chromium.org/3175012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56146 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/extensions_service.cc | 14 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_service.h | 3 |
2 files changed, 8 insertions, 9 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc index 21d8c58..22c4270 100644 --- a/chrome/browser/extensions/extensions_service.cc +++ b/chrome/browser/extensions/extensions_service.cc @@ -120,16 +120,16 @@ PendingExtensionInfo::PendingExtensionInfo() const char* ExtensionsService::kInstallDirectoryName = "Extensions"; const char* ExtensionsService::kCurrentVersionFileName = "Current Version"; -bool ExtensionsService::IsGalleryDownloadURL(const GURL& download_url) { +namespace { + +bool IsGalleryDownloadURL(const GURL& download_url) { if (StartsWithASCII(download_url.spec(), extension_urls::kMiniGalleryDownloadPrefix, false)) return true; - GURL gallery_download_prefix(extension_urls::kGalleryDownloadPrefix); - if (download_url.host() == gallery_download_prefix.host() && - StartsWithASCII(download_url.path(), - gallery_download_prefix.path(), false)) - return true; + if (StartsWithASCII(download_url.spec(), + extension_urls::kGalleryDownloadPrefix, false)) + return true; // Allow command line gallery url to be referrer for the gallery downloads. std::string command_line_gallery_url = @@ -143,6 +143,8 @@ bool ExtensionsService::IsGalleryDownloadURL(const GURL& download_url) { return false; } +} // namespace + // static bool ExtensionsService::IsDownloadFromGallery(const GURL& download_url, const GURL& referrer_url) { diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h index 0506299..e5f15d2 100644 --- a/chrome/browser/extensions/extensions_service.h +++ b/chrome/browser/extensions/extensions_service.h @@ -115,9 +115,6 @@ class ExtensionsService // The name of the file that the current active version number is stored in. static const char* kCurrentVersionFileName; - // Determine if the given url is an instance of a gallery download url. - static bool IsGalleryDownloadURL(const GURL& download_url); - // Determine if a given extension download should be treated as if it came // from the gallery. Note that this is different from IsGalleryDownloadURL // (above) in that in requires *both* that the download_url match and |