diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-17 20:21:04 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-17 20:21:04 +0000 |
commit | 5d9163e2136f0b4eef4aac3e650f1b6e655118fd (patch) | |
tree | ed86b9c0422989d8c4d90cf628ca9f6239bd5d8b /chrome/browser/appcache | |
parent | 87c23d51618a288127eed63419e4f26d770f74c5 (diff) | |
download | chromium_src-5d9163e2136f0b4eef4aac3e650f1b6e655118fd.zip chromium_src-5d9163e2136f0b4eef4aac3e650f1b6e655118fd.tar.gz chromium_src-5d9163e2136f0b4eef4aac3e650f1b6e655118fd.tar.bz2 |
Remove vestigial cookie/web app permissions prompting UI now that the async UI has been approved for M7.This allows me to more easily change the way the appmodal dialog system works.
http://crbug.com/55121
TEST=existing tests
Review URL: http://codereview.chromium.org/3299020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59838 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/appcache')
-rw-r--r-- | chrome/browser/appcache/chrome_appcache_service.cc | 76 | ||||
-rw-r--r-- | chrome/browser/appcache/chrome_appcache_service.h | 9 |
2 files changed, 0 insertions, 85 deletions
diff --git a/chrome/browser/appcache/chrome_appcache_service.cc b/chrome/browser/appcache/chrome_appcache_service.cc index 6188a3f..58a398e 100644 --- a/chrome/browser/appcache/chrome_appcache_service.cc +++ b/chrome/browser/appcache/chrome_appcache_service.cc @@ -7,8 +7,6 @@ #include "base/file_path.h" #include "base/file_util.h" #include "chrome/browser/browser_list.h" -#include "chrome/browser/cookie_prompt_modal_dialog_delegate.h" -#include "chrome/browser/message_box_handler.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/notification_service.h" @@ -17,32 +15,6 @@ static bool has_initialized_thread_ids; -// ChromeAppCacheService cannot just subclass the delegate interface -// because we may have several prompts pending. -class ChromeAppCacheService::PromptDelegate - : public CookiePromptModalDialogDelegate { - public: - PromptDelegate(ChromeAppCacheService* service, - const GURL& manifest_url, net::CompletionCallback* callback) - : service_(service), manifest_url_(manifest_url), callback_(callback) { - } - - virtual void AllowSiteData(bool session_expire) { - service_->DidPrompt(net::OK, manifest_url_, callback_); - delete this; - } - - virtual void BlockSiteData() { - service_->DidPrompt(net::ERR_ACCESS_DENIED, manifest_url_, callback_); - delete this; - } - - private: - scoped_refptr<ChromeAppCacheService> service_; - GURL manifest_url_; - net::CompletionCallback* callback_; -}; - // ---------------------------------------------------------------------------- ChromeAppCacheService::ChromeAppCacheService() { @@ -106,58 +78,10 @@ int ChromeAppCacheService::CanCreateAppCache( ContentSetting setting = host_contents_settings_map_->GetContentSetting( manifest_url, CONTENT_SETTINGS_TYPE_COOKIES, ""); DCHECK(setting != CONTENT_SETTING_DEFAULT); - if (setting == CONTENT_SETTING_ASK) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, - NewRunnableMethod(this, &ChromeAppCacheService::DoPrompt, - manifest_url, callback)); - return net::ERR_IO_PENDING; - } return (setting != CONTENT_SETTING_BLOCK) ? net::OK : net::ERR_ACCESS_DENIED; } -void ChromeAppCacheService::DoPrompt( - const GURL& manifest_url, net::CompletionCallback* callback) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); - - // The setting may have changed (due to the "remember" option) - ContentSetting setting = host_contents_settings_map_->GetContentSetting( - manifest_url, CONTENT_SETTINGS_TYPE_COOKIES, ""); - if (setting != CONTENT_SETTING_ASK) { - int rv = (setting != CONTENT_SETTING_BLOCK) ? net::OK : - net::ERR_ACCESS_DENIED; - DidPrompt(rv, manifest_url, callback); - return; - } - - // Show the prompt on top of the current tab. - Browser* browser = BrowserList::GetLastActive(); - if (!browser || !browser->GetSelectedTabContents()) { - DidPrompt(net::ERR_ACCESS_DENIED, manifest_url, callback); - return; - } - - RunAppCachePrompt(browser->GetSelectedTabContents(), - host_contents_settings_map_, manifest_url, - new PromptDelegate(this, manifest_url, callback)); -} - -void ChromeAppCacheService::DidPrompt( - int rv, const GURL& manifest_url, net::CompletionCallback* callback) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); - ChromeThread::PostTask( - ChromeThread::IO, FROM_HERE, - NewRunnableMethod(this, &ChromeAppCacheService::CallCallback, - rv, callback)); -} - -void ChromeAppCacheService::CallCallback( - int rv, net::CompletionCallback* callback) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); - callback->Run(rv); -} - void ChromeAppCacheService::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { diff --git a/chrome/browser/appcache/chrome_appcache_service.h b/chrome/browser/appcache/chrome_appcache_service.h index 25b2eee..9c33c04 100644 --- a/chrome/browser/appcache/chrome_appcache_service.h +++ b/chrome/browser/appcache/chrome_appcache_service.h @@ -48,8 +48,6 @@ class ChromeAppCacheService friend class ChromeThread; friend class DeleteTask<ChromeAppCacheService>; - class PromptDelegate; - virtual ~ChromeAppCacheService(); // AppCachePolicy overrides @@ -57,13 +55,6 @@ class ChromeAppCacheService virtual int CanCreateAppCache(const GURL& manifest_url, net::CompletionCallback* callback); - // The DoPrompt and DidPrrompt methods are called on the UI thread, and - // the following CallCallback method is called on the IO thread. - void DoPrompt(const GURL& manifest_url, net::CompletionCallback* callback); - void DidPrompt(int rv, const GURL& manifest_url, - net::CompletionCallback* callback); - void CallCallback(int rv, net::CompletionCallback* callback); - // NotificationObserver override virtual void Observe(NotificationType type, const NotificationSource& source, |