OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_queue_controller.h" | 5 #include "chrome/browser/content_settings/permission_queue_controller.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.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_context_uma_util.h" | 10 #include "chrome/browser/content_settings/permission_context_uma_util.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 bool allowed) { | 362 bool allowed) { |
363 if (requesting_frame.GetOrigin().SchemeIsFile()) { | 363 if (requesting_frame.GetOrigin().SchemeIsFile()) { |
364 // Chrome can be launched with --disable-web-security which allows | 364 // Chrome can be launched with --disable-web-security which allows |
365 // geolocation requests from file:// URLs. We don't want to store these | 365 // geolocation requests from file:// URLs. We don't want to store these |
366 // in the host content settings map. | 366 // in the host content settings map. |
367 return; | 367 return; |
368 } | 368 } |
369 | 369 |
370 ContentSetting content_setting = | 370 ContentSetting content_setting = |
371 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; | 371 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; |
| 372 |
| 373 ContentSettingsPattern embedder_pattern = |
| 374 (type_ == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) ? |
| 375 ContentSettingsPattern::Wildcard() : |
| 376 ContentSettingsPattern::FromURLNoWildcard(embedder.GetOrigin()); |
| 377 |
372 profile_->GetHostContentSettingsMap()->SetContentSetting( | 378 profile_->GetHostContentSettingsMap()->SetContentSetting( |
373 ContentSettingsPattern::FromURLNoWildcard(requesting_frame.GetOrigin()), | 379 ContentSettingsPattern::FromURLNoWildcard(requesting_frame.GetOrigin()), |
374 ContentSettingsPattern::FromURLNoWildcard(embedder.GetOrigin()), | 380 embedder_pattern, |
375 type_, | 381 type_, |
376 std::string(), | 382 std::string(), |
377 content_setting); | 383 content_setting); |
378 } | 384 } |
OLD | NEW |