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/renderer_host | |
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/renderer_host')
3 files changed, 0 insertions, 177 deletions
diff --git a/chrome/browser/renderer_host/database_dispatcher_host.cc b/chrome/browser/renderer_host/database_dispatcher_host.cc index b592b1b..3efb836 100644 --- a/chrome/browser/renderer_host/database_dispatcher_host.cc +++ b/chrome/browser/renderer_host/database_dispatcher_host.cc @@ -15,7 +15,6 @@ #include "chrome/browser/host_content_settings_map.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/renderer_host/browser_render_process_host.h" -#include "chrome/browser/renderer_host/database_permission_request.h" #include "chrome/common/render_messages.h" #include "googleurl/src/gurl.h" #include "third_party/sqlite/sqlite3.h" @@ -390,26 +389,6 @@ void DatabaseDispatcherHost::OnAllowDatabase(const std::string& origin_url, ContentSetting content_setting = host_content_settings_map_->GetContentSetting( url, CONTENT_SETTINGS_TYPE_COOKIES, ""); - if (content_setting == CONTENT_SETTING_ASK) { - // Create a task for each possible outcome. - scoped_ptr<Task> on_allow(NewRunnableMethod( - this, &DatabaseDispatcherHost::AllowDatabaseResponse, - reply_msg, CONTENT_SETTING_ALLOW)); - scoped_ptr<Task> on_block(NewRunnableMethod( - this, &DatabaseDispatcherHost::AllowDatabaseResponse, - reply_msg, CONTENT_SETTING_BLOCK)); - // And then let the permission request object do the rest. - scoped_refptr<DatabasePermissionRequest> request( - new DatabasePermissionRequest(url, name, display_name, estimated_size, - on_allow.release(), on_block.release(), - host_content_settings_map_)); - request->RequestPermission(); - - // Tell the renderer that it needs to run a nested message loop. - Send(new ViewMsg_SignalCookiePromptEvent()); - return; - } - AllowDatabaseResponse(reply_msg, content_setting); } diff --git a/chrome/browser/renderer_host/database_permission_request.cc b/chrome/browser/renderer_host/database_permission_request.cc deleted file mode 100644 index 317c7f9..0000000 --- a/chrome/browser/renderer_host/database_permission_request.cc +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/renderer_host/database_permission_request.h" - - -#include "chrome/browser/browser_list.h" -#include "chrome/browser/chrome_thread.h" -#include "chrome/browser/host_content_settings_map.h" -#include "chrome/browser/message_box_handler.h" - -DatabasePermissionRequest::DatabasePermissionRequest( - const GURL& url, - const string16& database_name, - const string16& display_name, - unsigned long estimated_size, - Task* on_allow, - Task* on_block, - HostContentSettingsMap* settings_map) - : url_(url), - database_name_(database_name), - display_name_(display_name), - estimated_size_(estimated_size), - on_allow_(on_allow), - on_block_(on_block), - host_content_settings_map_(settings_map) { - DCHECK(on_allow_.get()); - DCHECK(on_block_.get()); -} - -DatabasePermissionRequest::~DatabasePermissionRequest() { -} - -void DatabasePermissionRequest::RequestPermission() { - if (ChromeThread::CurrentlyOn(ChromeThread::IO)) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, NewRunnableMethod( - this, &DatabasePermissionRequest::RequestPermission)); - return; - } - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); - - // Cookie settings may have changed. - ContentSetting setting = host_content_settings_map_->GetContentSetting( - url_, CONTENT_SETTINGS_TYPE_COOKIES, ""); - if (setting != CONTENT_SETTING_ASK) { - SendResponse(setting); - return; - } - - Browser* browser = BrowserList::GetLastActive(); - if (!browser || !browser->GetSelectedTabContents()) { - BlockSiteData(); - return; - } - - self_ref_ = this; - // Will call either AllowSiteData or BlockSiteData which will NULL out our - // self reference. - RunDatabasePrompt(browser->GetSelectedTabContents(), - host_content_settings_map_, url_, database_name_, - display_name_, estimated_size_, this); -} - -void DatabasePermissionRequest::AllowSiteData(bool session_expire) { - SendResponse(CONTENT_SETTING_ALLOW); -} - -void DatabasePermissionRequest::BlockSiteData() { - SendResponse(CONTENT_SETTING_BLOCK); -} - -void DatabasePermissionRequest::SendResponse(ContentSetting content_setting) { - if (content_setting == CONTENT_SETTING_ALLOW) { - ChromeThread::PostTask(ChromeThread::IO, FROM_HERE, on_allow_.release()); - } else { - DCHECK(content_setting == CONTENT_SETTING_BLOCK); - ChromeThread::PostTask(ChromeThread::IO, FROM_HERE, on_block_.release()); - } - - // Release all resources. - on_allow_.reset(); - on_block_.reset(); - - // This seems safer than possibly being deleted while in method(s) related to - // this object. Any thread will do, but UI is always around and can be - // posted without locking, so we'll ask it to do the release. - ChromeThread::ReleaseSoon(ChromeThread::UI, FROM_HERE, self_ref_.release()); -} diff --git a/chrome/browser/renderer_host/database_permission_request.h b/chrome/browser/renderer_host/database_permission_request.h deleted file mode 100644 index abe5d20..0000000 --- a/chrome/browser/renderer_host/database_permission_request.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_RENDERER_HOST_DATABASE_PERMISSION_REQUEST_H_ -#define CHROME_BROWSER_RENDERER_HOST_DATABASE_PERMISSION_REQUEST_H_ -#pragma once - -#include "base/ref_counted.h" -#include "base/scoped_ptr.h" -#include "base/string16.h" -#include "chrome/browser/cookie_prompt_modal_dialog_delegate.h" -#include "chrome/common/content_settings.h" -#include "googleurl/src/gurl.h" - -class HostContentSettingsMap; -class Task; - -// This class is fully threadsafe. -class DatabasePermissionRequest - : public base::RefCountedThreadSafe<DatabasePermissionRequest>, - public CookiePromptModalDialogDelegate { - public: - DatabasePermissionRequest(const GURL& url, - const string16& database_name, - const string16& display_name, - unsigned long estimated_size, - Task* on_allow, - Task* on_block, - HostContentSettingsMap* settings_map); - ~DatabasePermissionRequest(); - - const GURL& url() const { return url_; } - const string16& database_name() const { return database_name_; } - const string16& display_name() const { return display_name_; } - unsigned long estimated_size() const { return estimated_size_; } - - // Start the permission request process. - void RequestPermission(); - - // CookiesPromptViewDelegate methods: - virtual void AllowSiteData(bool session_expire); - virtual void BlockSiteData(); - - private: - void SendResponse(ContentSetting content_setting); - - // The URL to get permission for. - const GURL url_; - const string16 database_name_; - const string16 display_name_; - unsigned long estimated_size_; - - // Set on IO, possibly release()ed on UI, destroyed on IO or UI. - scoped_ptr<Task> on_allow_; - scoped_ptr<Task> on_block_; - - scoped_refptr<HostContentSettingsMap> host_content_settings_map_; - - // Released once we have our answer. - scoped_refptr<DatabasePermissionRequest> self_ref_; - - DISALLOW_IMPLICIT_CONSTRUCTORS(DatabasePermissionRequest); -}; - -#endif // CHROME_BROWSER_RENDERER_HOST_DATABASE_PERMISSION_REQUEST_H_ |