Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Side by Side Diff: chrome/browser/content_settings/permission_queue_controller.cc

Issue 343743004: Implement a permission check for push. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased and addressed Michael's comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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(GetInfoBarService(id_),
Bernhard Bauer 2014/06/19 18:13:18 Nit: Other ::Create methods here put multiple para
Miguel Garcia 2014/06/19 21:49:22 Done.
123 controller,
124 id_,
125 requesting_frame_,
126 display_languages);
127 break;
120 #if defined(OS_ANDROID) 128 #if defined(OS_ANDROID)
121 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: 129 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER:
122 infobar_ = ProtectedMediaIdentifierInfoBarDelegate::Create( 130 infobar_ = ProtectedMediaIdentifierInfoBarDelegate::Create(
123 GetInfoBarService(id_), controller, id_, requesting_frame_, 131 GetInfoBarService(id_), controller, id_, requesting_frame_,
124 display_languages); 132 display_languages);
125 break; 133 break;
126 #endif 134 #endif
127 default: 135 default:
128 NOTREACHED(); 136 NOTREACHED();
129 break; 137 break;
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 356
349 ContentSetting content_setting = 357 ContentSetting content_setting =
350 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; 358 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK;
351 profile_->GetHostContentSettingsMap()->SetContentSetting( 359 profile_->GetHostContentSettingsMap()->SetContentSetting(
352 ContentSettingsPattern::FromURLNoWildcard(requesting_frame.GetOrigin()), 360 ContentSettingsPattern::FromURLNoWildcard(requesting_frame.GetOrigin()),
353 ContentSettingsPattern::FromURLNoWildcard(embedder.GetOrigin()), 361 ContentSettingsPattern::FromURLNoWildcard(embedder.GetOrigin()),
354 type_, 362 type_,
355 std::string(), 363 std::string(),
356 content_setting); 364 content_setting);
357 } 365 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698