Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: chrome/browser/renderer_host/database_permission_request.cc

Issue 2878075: Introduce a resource identifier for content settings. (Closed)
Patch Set: updates Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/renderer_host/database_permission_request.h" 5 #include "chrome/browser/renderer_host/database_permission_request.h"
6 6
7 7
8 #include "chrome/browser/browser_list.h" 8 #include "chrome/browser/browser_list.h"
9 #include "chrome/browser/chrome_thread.h" 9 #include "chrome/browser/chrome_thread.h"
10 #include "chrome/browser/host_content_settings_map.h" 10 #include "chrome/browser/host_content_settings_map.h"
(...skipping 25 matching lines...) Expand all
36 if (ChromeThread::CurrentlyOn(ChromeThread::IO)) { 36 if (ChromeThread::CurrentlyOn(ChromeThread::IO)) {
37 ChromeThread::PostTask( 37 ChromeThread::PostTask(
38 ChromeThread::UI, FROM_HERE, NewRunnableMethod( 38 ChromeThread::UI, FROM_HERE, NewRunnableMethod(
39 this, &DatabasePermissionRequest::RequestPermission)); 39 this, &DatabasePermissionRequest::RequestPermission));
40 return; 40 return;
41 } 41 }
42 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); 42 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
43 43
44 // Cookie settings may have changed. 44 // Cookie settings may have changed.
45 ContentSetting setting = host_content_settings_map_->GetContentSetting( 45 ContentSetting setting = host_content_settings_map_->GetContentSetting(
46 url_, CONTENT_SETTINGS_TYPE_COOKIES); 46 url_, CONTENT_SETTINGS_TYPE_COOKIES, "");
47 if (setting != CONTENT_SETTING_ASK) { 47 if (setting != CONTENT_SETTING_ASK) {
48 SendResponse(setting); 48 SendResponse(setting);
49 return; 49 return;
50 } 50 }
51 51
52 Browser* browser = BrowserList::GetLastActive(); 52 Browser* browser = BrowserList::GetLastActive();
53 if (!browser || !browser->GetSelectedTabContents()) { 53 if (!browser || !browser->GetSelectedTabContents()) {
54 BlockSiteData(); 54 BlockSiteData();
55 return; 55 return;
56 } 56 }
(...skipping 24 matching lines...) Expand all
81 81
82 // Release all resources. 82 // Release all resources.
83 on_allow_.reset(); 83 on_allow_.reset();
84 on_block_.reset(); 84 on_block_.reset();
85 85
86 // This seems safer than possibly being deleted while in method(s) related to 86 // This seems safer than possibly being deleted while in method(s) related to
87 // this object. Any thread will do, but UI is always around and can be 87 // this object. Any thread will do, but UI is always around and can be
88 // posted without locking, so we'll ask it to do the release. 88 // posted without locking, so we'll ask it to do the release.
89 ChromeThread::ReleaseSoon(ChromeThread::UI, FROM_HERE, self_ref_.release()); 89 ChromeThread::ReleaseSoon(ChromeThread::UI, FROM_HERE, self_ref_.release());
90 } 90 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/database_dispatcher_host.cc ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698