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

Side by Side Diff: chrome/browser/content_settings/permission_context_base.cc

Issue 622793002: Group the different permission related methods in the content api. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/content_settings/permission_context_base.h" 5 #include "chrome/browser/content_settings/permission_context_base.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/content_settings/host_content_settings_map.h" 9 #include "chrome/browser/content_settings/host_content_settings_map.h"
10 #include "chrome/browser/content_settings/permission_bubble_request_impl.h" 10 #include "chrome/browser/content_settings/permission_bubble_request_impl.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 id, 44 id,
45 requesting_frame.GetOrigin(), 45 requesting_frame.GetOrigin(),
46 web_contents->GetLastCommittedURL().GetOrigin(), 46 web_contents->GetLastCommittedURL().GetOrigin(),
47 user_gesture, 47 user_gesture,
48 callback); 48 callback);
49 } 49 }
50 50
51 void PermissionContextBase::CancelPermissionRequest( 51 void PermissionContextBase::CancelPermissionRequest(
52 content::WebContents* web_contents, 52 content::WebContents* web_contents,
53 const PermissionRequestID& id) { 53 const PermissionRequestID& id) {
54 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 54 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
55 55
56 if (PermissionBubbleManager::Enabled()) { 56 if (PermissionBubbleManager::Enabled()) {
57 PermissionBubbleRequest* cancelling = 57 PermissionBubbleRequest* cancelling =
58 pending_bubbles_.get(id.ToString()); 58 pending_bubbles_.get(id.ToString());
59 if (cancelling != NULL && web_contents != NULL && 59 if (cancelling != NULL && web_contents != NULL &&
60 PermissionBubbleManager::FromWebContents(web_contents) != NULL) { 60 PermissionBubbleManager::FromWebContents(web_contents) != NULL) {
61 PermissionBubbleManager::FromWebContents(web_contents)-> 61 PermissionBubbleManager::FromWebContents(web_contents)->
62 CancelRequest(cancelling); 62 CancelRequest(cancelling);
63 } 63 }
64 return; 64 return;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 DCHECK_EQ(embedder_origin, embedder_origin.GetOrigin()); 200 DCHECK_EQ(embedder_origin, embedder_origin.GetOrigin());
201 ContentSetting content_setting = 201 ContentSetting content_setting =
202 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; 202 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK;
203 profile_->GetHostContentSettingsMap()->SetContentSetting( 203 profile_->GetHostContentSettingsMap()->SetContentSetting(
204 ContentSettingsPattern::FromURLNoWildcard(requesting_origin), 204 ContentSettingsPattern::FromURLNoWildcard(requesting_origin),
205 ContentSettingsPattern::FromURLNoWildcard(embedder_origin), 205 ContentSettingsPattern::FromURLNoWildcard(embedder_origin),
206 permission_type_, 206 permission_type_,
207 std::string(), 207 std::string(),
208 content_setting); 208 content_setting);
209 } 209 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698