OLD | NEW |
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 bubble_manager->AddRequest(request); | 103 bubble_manager->AddRequest(request); |
104 return; | 104 return; |
105 } | 105 } |
106 | 106 |
107 // TODO(gbillock): Delete this and the infobar delegate when | 107 // TODO(gbillock): Delete this and the infobar delegate when |
108 // we're using only bubbles. crbug.com/337458 | 108 // we're using only bubbles. crbug.com/337458 |
109 GetQueueController()->CreateInfoBarRequest( | 109 GetQueueController()->CreateInfoBarRequest( |
110 id, | 110 id, |
111 requesting_origin, | 111 requesting_origin, |
112 embedder_origin, | 112 embedder_origin, |
113 std::string(), | |
114 base::Bind(&PermissionContextBase::PermissionDecided, | 113 base::Bind(&PermissionContextBase::PermissionDecided, |
115 weak_factory_.GetWeakPtr(), | 114 weak_factory_.GetWeakPtr(), |
116 id, | 115 id, |
117 requesting_origin, | 116 requesting_origin, |
118 embedder_origin, | 117 embedder_origin, |
119 callback, | 118 callback, |
120 // the queue controller takes care of persisting the | 119 // the queue controller takes care of persisting the |
121 // permission | 120 // permission |
122 false)); | 121 false)); |
123 } | 122 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 DCHECK_EQ(embedder_origin, embedder_origin.GetOrigin()); | 178 DCHECK_EQ(embedder_origin, embedder_origin.GetOrigin()); |
180 ContentSetting content_setting = | 179 ContentSetting content_setting = |
181 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; | 180 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; |
182 profile_->GetHostContentSettingsMap()->SetContentSetting( | 181 profile_->GetHostContentSettingsMap()->SetContentSetting( |
183 ContentSettingsPattern::FromURLNoWildcard(requesting_origin), | 182 ContentSettingsPattern::FromURLNoWildcard(requesting_origin), |
184 ContentSettingsPattern::FromURLNoWildcard(embedder_origin), | 183 ContentSettingsPattern::FromURLNoWildcard(embedder_origin), |
185 permission_type_, | 184 permission_type_, |
186 std::string(), | 185 std::string(), |
187 content_setting); | 186 content_setting); |
188 } | 187 } |
OLD | NEW |