From dbeb39586fd6d8e75ed6ad4e6c4606ee16e53348 Mon Sep 17 00:00:00 2001 From: "jamesr@chromium.org" Date: Tue, 13 Oct 2009 18:01:18 +0000 Subject: This patch enables "Save page as" (ctrl+s) for resources located at chrome-extension URLs. In the absence of any API for doing file I/O this adds very useful functionality to chrome extensions. This patch is needed to allow APU to save its instrumentation data to disk without the need for a plugin. patch by: Jaime Yap (jaimeyap@google.com) BUG=none TEST=Bundle a page "foo.html" with an extension. Usings the tabs API or window.open, open "foo.html" in the extensions process. Try to save it using CTRL+S. (You can test with any of the existing samples that bundle a page). Review URL: http://codereview.chromium.org/266051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28839 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/download/save_package.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'chrome/browser/download') diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc index 3c4c7a6..ac4a39e 100644 --- a/chrome/browser/download/save_package.cc +++ b/chrome/browser/download/save_package.cc @@ -1193,10 +1193,12 @@ void SavePackage::ContinueSave(SavePackageParam* param, // Static bool SavePackage::IsSavableURL(const GURL& url) { - return url.SchemeIs(chrome::kHttpScheme) || - url.SchemeIs(chrome::kHttpsScheme) || - url.SchemeIs(chrome::kFileScheme) || - url.SchemeIs(chrome::kFtpScheme); + for (int i = 0; chrome::kSavableSchemes[i] != NULL; ++i) { + if (url.SchemeIs(chrome::kSavableSchemes[i])) { + return true; + } + } + return false; } // Static -- cgit v1.1