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" |
11 #include "chrome/browser/content_settings/permission_context_uma_util.h" | 11 #include "chrome/browser/content_settings/permission_context_uma_util.h" |
12 #include "chrome/browser/content_settings/permission_queue_controller.h" | 12 #include "chrome/browser/content_settings/permission_queue_controller.h" |
13 #include "chrome/browser/content_settings/permission_request_id.h" | |
14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 13 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 15 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
17 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 #include "components/content_settings/core/common/permission_request_id.h" |
18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
19 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
20 | 20 |
21 PermissionContextBase::PermissionContextBase( | 21 PermissionContextBase::PermissionContextBase( |
22 Profile* profile, | 22 Profile* profile, |
23 const ContentSettingsType permission_type) | 23 const ContentSettingsType permission_type) |
24 : profile_(profile), | 24 : profile_(profile), |
25 permission_type_(permission_type), | 25 permission_type_(permission_type), |
26 weak_factory_(this) { | 26 weak_factory_(this) { |
27 permission_queue_controller_.reset( | 27 permission_queue_controller_.reset( |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 DCHECK_EQ(embedder_origin, embedder_origin.GetOrigin()); | 176 DCHECK_EQ(embedder_origin, embedder_origin.GetOrigin()); |
177 ContentSetting content_setting = | 177 ContentSetting content_setting = |
178 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; | 178 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; |
179 profile_->GetHostContentSettingsMap()->SetContentSetting( | 179 profile_->GetHostContentSettingsMap()->SetContentSetting( |
180 ContentSettingsPattern::FromURLNoWildcard(requesting_origin), | 180 ContentSettingsPattern::FromURLNoWildcard(requesting_origin), |
181 ContentSettingsPattern::FromURLNoWildcard(embedder_origin), | 181 ContentSettingsPattern::FromURLNoWildcard(embedder_origin), |
182 permission_type_, | 182 permission_type_, |
183 std::string(), | 183 std::string(), |
184 content_setting); | 184 content_setting); |
185 } | 185 } |
OLD | NEW |