| 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" | |
| 10 #include "chrome/browser/content_settings/permission_bubble_request_impl.h" | 9 #include "chrome/browser/content_settings/permission_bubble_request_impl.h" |
| 11 #include "chrome/browser/content_settings/permission_context_uma_util.h" | 10 #include "chrome/browser/content_settings/permission_context_uma_util.h" |
| 12 #include "chrome/browser/content_settings/permission_queue_controller.h" | 11 #include "chrome/browser/content_settings/permission_queue_controller.h" |
| 13 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 12 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 14 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
| 16 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 16 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 17 #include "components/content_settings/core/common/permission_request_id.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) { |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |