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" | 13 #include "chrome/browser/content_settings/permission_request_id.h" |
14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 16 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.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 #include "grit/generated_resources.h" | |
21 #include "grit/theme_resources.h" | |
22 | 20 |
23 PermissionContextBase::PermissionContextBase( | 21 PermissionContextBase::PermissionContextBase( |
24 Profile* profile, | 22 Profile* profile, |
25 const ContentSettingsType permission_type) | 23 const ContentSettingsType permission_type) |
26 : profile_(profile), | 24 : profile_(profile), |
27 permission_type_(permission_type), | 25 permission_type_(permission_type), |
28 weak_factory_(this) { | 26 weak_factory_(this) { |
29 permission_queue_controller_.reset( | 27 permission_queue_controller_.reset( |
30 new PermissionQueueController(profile_, permission_type_)); | 28 new PermissionQueueController(profile_, permission_type_)); |
31 } | 29 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 DCHECK_EQ(embedder_origin, embedder_origin.GetOrigin()); | 176 DCHECK_EQ(embedder_origin, embedder_origin.GetOrigin()); |
179 ContentSetting content_setting = | 177 ContentSetting content_setting = |
180 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; | 178 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; |
181 profile_->GetHostContentSettingsMap()->SetContentSetting( | 179 profile_->GetHostContentSettingsMap()->SetContentSetting( |
182 ContentSettingsPattern::FromURLNoWildcard(requesting_origin), | 180 ContentSettingsPattern::FromURLNoWildcard(requesting_origin), |
183 ContentSettingsPattern::FromURLNoWildcard(embedder_origin), | 181 ContentSettingsPattern::FromURLNoWildcard(embedder_origin), |
184 permission_type_, | 182 permission_type_, |
185 std::string(), | 183 std::string(), |
186 content_setting); | 184 content_setting); |
187 } | 185 } |
OLD | NEW |