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/geolocation/geolocation_infobar_delegate.h" | 10 #include "chrome/browser/geolocation/geolocation_infobar_delegate.h" |
11 #include "chrome/browser/infobars/infobar_service.h" | 11 #include "chrome/browser/infobars/infobar_service.h" |
12 #include "chrome/browser/media/midi_permission_infobar_delegate.h" | 12 #include "chrome/browser/media/midi_permission_infobar_delegate.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/services/gcm/gcm_infobar_delegate.h" |
14 #include "chrome/browser/tab_contents/tab_util.h" | 15 #include "chrome/browser/tab_contents/tab_util.h" |
15 #include "chrome/common/content_settings.h" | 16 #include "chrome/common/content_settings.h" |
16 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
17 #include "components/infobars/core/infobar.h" | 18 #include "components/infobars/core/infobar.h" |
18 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
19 #include "content/public/browser/notification_details.h" | 20 #include "content/public/browser/notification_details.h" |
20 #include "content/public/browser/notification_source.h" | 21 #include "content/public/browser/notification_source.h" |
21 #include "content/public/browser/notification_types.h" | 22 #include "content/public/browser/notification_types.h" |
22 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
23 | 24 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 case CONTENT_SETTINGS_TYPE_GEOLOCATION: | 111 case CONTENT_SETTINGS_TYPE_GEOLOCATION: |
111 infobar_ = GeolocationInfoBarDelegate::Create( | 112 infobar_ = GeolocationInfoBarDelegate::Create( |
112 GetInfoBarService(id_), controller, id_, requesting_frame_, | 113 GetInfoBarService(id_), controller, id_, requesting_frame_, |
113 display_languages, accept_button_label_); | 114 display_languages, accept_button_label_); |
114 break; | 115 break; |
115 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: | 116 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: |
116 infobar_ = MidiPermissionInfoBarDelegate::Create( | 117 infobar_ = MidiPermissionInfoBarDelegate::Create( |
117 GetInfoBarService(id_), controller, id_, requesting_frame_, | 118 GetInfoBarService(id_), controller, id_, requesting_frame_, |
118 display_languages); | 119 display_languages); |
119 break; | 120 break; |
| 121 case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING: |
| 122 infobar_ = gcm::GCMInfoBarDelegate::Create( |
| 123 GetInfoBarService(id_), controller, id_, requesting_frame_, |
| 124 display_languages); |
| 125 break; |
120 #if defined(OS_ANDROID) | 126 #if defined(OS_ANDROID) |
121 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: | 127 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: |
122 infobar_ = ProtectedMediaIdentifierInfoBarDelegate::Create( | 128 infobar_ = ProtectedMediaIdentifierInfoBarDelegate::Create( |
123 GetInfoBarService(id_), controller, id_, requesting_frame_, | 129 GetInfoBarService(id_), controller, id_, requesting_frame_, |
124 display_languages); | 130 display_languages); |
125 break; | 131 break; |
126 #endif | 132 #endif |
127 default: | 133 default: |
128 NOTREACHED(); | 134 NOTREACHED(); |
129 break; | 135 break; |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 354 |
349 ContentSetting content_setting = | 355 ContentSetting content_setting = |
350 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; | 356 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; |
351 profile_->GetHostContentSettingsMap()->SetContentSetting( | 357 profile_->GetHostContentSettingsMap()->SetContentSetting( |
352 ContentSettingsPattern::FromURLNoWildcard(requesting_frame.GetOrigin()), | 358 ContentSettingsPattern::FromURLNoWildcard(requesting_frame.GetOrigin()), |
353 ContentSettingsPattern::FromURLNoWildcard(embedder.GetOrigin()), | 359 ContentSettingsPattern::FromURLNoWildcard(embedder.GetOrigin()), |
354 type_, | 360 type_, |
355 std::string(), | 361 std::string(), |
356 content_setting); | 362 content_setting); |
357 } | 363 } |
OLD | NEW |