summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authorrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-08 00:47:23 +0000
committerrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-08 00:47:23 +0000
commitb7c2f25802d9e74c4aec3f0b99feed1b7a951bad (patch)
treee674c739e2fce2326f82e5b1997b0564e1e28a94 /chrome/browser/extensions
parent900eef6269a3fcf167bc1a05036b2b1420dd85e1 (diff)
downloadchromium_src-b7c2f25802d9e74c4aec3f0b99feed1b7a951bad.zip
chromium_src-b7c2f25802d9e74c4aec3f0b99feed1b7a951bad.tar.gz
chromium_src-b7c2f25802d9e74c4aec3f0b99feed1b7a951bad.tar.bz2
Revert "Allow silent extension installations from the extensions gallery - Part 1."
Original CL: http://codereview.chromium.org/400018/show Looks like we're no longer hoping to get this approach into mstone4 release, so I'm unwinding this. BUG=27431 TBR=aa Review URL: http://codereview.chromium.org/467042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34025 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/extensions_service.cc20
-rw-r--r--chrome/browser/extensions/extensions_service.h5
2 files changed, 25 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 2ae7f5e..058907e 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -81,6 +81,26 @@ class InstalledExtensionSet {
const char* ExtensionsService::kInstallDirectoryName = "Extensions";
const char* ExtensionsService::kCurrentVersionFileName = "Current Version";
+// static
+bool ExtensionsService::IsDownloadFromGallery(const GURL& download_url,
+ const GURL& referrer_url) {
+ if (StartsWithASCII(download_url.spec(),
+ extension_urls::kMiniGalleryDownloadPrefix, false) &&
+ StartsWithASCII(referrer_url.spec(),
+ extension_urls::kMiniGalleryBrowsePrefix, false)) {
+ return true;
+ }
+
+ if (StartsWithASCII(download_url.spec(),
+ extension_urls::kGalleryDownloadPrefix, false) &&
+ StartsWithASCII(referrer_url.spec(),
+ extension_urls::kGalleryBrowsePrefix, false)) {
+ return true;
+ }
+
+ return false;
+}
+
ExtensionsService::ExtensionsService(Profile* profile,
const CommandLine* command_line,
PrefService* prefs,
diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h
index 0492538..30751f6 100644
--- a/chrome/browser/extensions/extensions_service.h
+++ b/chrome/browser/extensions/extensions_service.h
@@ -73,6 +73,11 @@ class ExtensionsService
// The name of the file that the current active version number is stored in.
static const char* kCurrentVersionFileName;
+ // Determine if a given extension download should be treated as if it came
+ // from the gallery.
+ static bool IsDownloadFromGallery(const GURL& download_url,
+ const GURL& referrer_url);
+
ExtensionsService(Profile* profile,
const CommandLine* command_line,
PrefService* prefs,