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

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

Issue 2316673002: Fix PushManager.subscribe() permission request on Android (Closed)
Patch Set: Also test notifications permission Created 4 years, 3 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
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/push_messaging/PushMessagingTest.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/permissions/permission_queue_controller.h" 5 #include "chrome/browser/permissions/permission_queue_controller.h"
6 6
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
9 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" 9 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h"
10 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 &PermissionQueueController::OnPermissionSet, base::Unretained(controller), 124 &PermissionQueueController::OnPermissionSet, base::Unretained(controller),
125 id_, requesting_frame_, embedder_, user_gesture_); 125 id_, requesting_frame_, embedder_, user_gesture_);
126 switch (type_) { 126 switch (type_) {
127 case content::PermissionType::GEOLOCATION: 127 case content::PermissionType::GEOLOCATION:
128 infobar_ = GeolocationInfoBarDelegateAndroid::Create( 128 infobar_ = GeolocationInfoBarDelegateAndroid::Create(
129 GetInfoBarService(id_), requesting_frame_, user_gesture_, profile_, 129 GetInfoBarService(id_), requesting_frame_, user_gesture_, profile_,
130 callback); 130 callback);
131 break; 131 break;
132 #if defined(ENABLE_NOTIFICATIONS) 132 #if defined(ENABLE_NOTIFICATIONS)
133 case content::PermissionType::NOTIFICATIONS: 133 case content::PermissionType::NOTIFICATIONS:
134 case content::PermissionType::PUSH_MESSAGING:
134 infobar_ = NotificationPermissionInfoBarDelegate::Create( 135 infobar_ = NotificationPermissionInfoBarDelegate::Create(
raymes 2016/09/06 23:06:38 This looks ok to merge to me. I think we actually
135 GetInfoBarService(id_), requesting_frame_, user_gesture_, profile_, 136 GetInfoBarService(id_), requesting_frame_, user_gesture_, profile_,
136 callback); 137 callback);
137 break; 138 break;
138 #endif // ENABLE_NOTIFICATIONS 139 #endif // ENABLE_NOTIFICATIONS
139 case content::PermissionType::MIDI_SYSEX: 140 case content::PermissionType::MIDI_SYSEX:
140 infobar_ = MidiPermissionInfoBarDelegateAndroid::Create( 141 infobar_ = MidiPermissionInfoBarDelegateAndroid::Create(
141 GetInfoBarService(id_), requesting_frame_, user_gesture_, profile_, 142 GetInfoBarService(id_), requesting_frame_, user_gesture_, profile_,
142 callback); 143 callback);
143 break; 144 break;
144 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: 145 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER:
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 } 413 }
413 414
414 ContentSetting content_setting = 415 ContentSetting content_setting =
415 (decision == GRANTED) ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; 416 (decision == GRANTED) ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK;
416 417
417 HostContentSettingsMapFactory::GetForProfile(profile_) 418 HostContentSettingsMapFactory::GetForProfile(profile_)
418 ->SetContentSettingDefaultScope( 419 ->SetContentSettingDefaultScope(
419 requesting_frame.GetOrigin(), embedder.GetOrigin(), 420 requesting_frame.GetOrigin(), embedder.GetOrigin(),
420 content_settings_type_, std::string(), content_setting); 421 content_settings_type_, std::string(), content_setting);
421 } 422 }
OLDNEW
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/push_messaging/PushMessagingTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698