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

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

Issue 2555833002: Remove enable_notifications build flag and define (Closed)
Patch Set: Merge Created 4 years 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
OLDNEW
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/permissions/permission_infobar_delegate.h" 5 #include "chrome/browser/permissions/permission_infobar_delegate.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" 10 #include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 content::PermissionType type, 45 content::PermissionType type,
46 const GURL& requesting_frame, 46 const GURL& requesting_frame,
47 bool user_gesture, 47 bool user_gesture,
48 Profile* profile, 48 Profile* profile,
49 const PermissionSetCallback& callback) { 49 const PermissionSetCallback& callback) {
50 switch (type) { 50 switch (type) {
51 case content::PermissionType::GEOLOCATION: 51 case content::PermissionType::GEOLOCATION:
52 return std::unique_ptr<PermissionInfoBarDelegate>( 52 return std::unique_ptr<PermissionInfoBarDelegate>(
53 new GeolocationInfoBarDelegateAndroid( 53 new GeolocationInfoBarDelegateAndroid(
54 requesting_frame, user_gesture, profile, callback)); 54 requesting_frame, user_gesture, profile, callback));
55 #if defined(ENABLE_NOTIFICATIONS)
56 case content::PermissionType::NOTIFICATIONS: 55 case content::PermissionType::NOTIFICATIONS:
57 case content::PermissionType::PUSH_MESSAGING: 56 case content::PermissionType::PUSH_MESSAGING:
58 return std::unique_ptr<PermissionInfoBarDelegate>( 57 return std::unique_ptr<PermissionInfoBarDelegate>(
59 new NotificationPermissionInfoBarDelegate( 58 new NotificationPermissionInfoBarDelegate(
60 type, requesting_frame, user_gesture, profile, callback)); 59 type, requesting_frame, user_gesture, profile, callback));
61 #endif // ENABLE_NOTIFICATIONS
62 case content::PermissionType::MIDI_SYSEX: 60 case content::PermissionType::MIDI_SYSEX:
63 return std::unique_ptr<PermissionInfoBarDelegate>( 61 return std::unique_ptr<PermissionInfoBarDelegate>(
64 new MidiPermissionInfoBarDelegateAndroid( 62 new MidiPermissionInfoBarDelegateAndroid(
65 requesting_frame, user_gesture, profile, callback)); 63 requesting_frame, user_gesture, profile, callback));
66 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: 64 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER:
67 return std::unique_ptr<PermissionInfoBarDelegate>( 65 return std::unique_ptr<PermissionInfoBarDelegate>(
68 new ProtectedMediaIdentifierInfoBarDelegateAndroid( 66 new ProtectedMediaIdentifierInfoBarDelegateAndroid(
69 requesting_frame, user_gesture, profile, callback)); 67 requesting_frame, user_gesture, profile, callback));
70 default: 68 default:
71 NOTREACHED(); 69 NOTREACHED();
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 PermissionInfoBarDelegate* 158 PermissionInfoBarDelegate*
161 PermissionInfoBarDelegate::AsPermissionInfoBarDelegate() { 159 PermissionInfoBarDelegate::AsPermissionInfoBarDelegate() {
162 return this; 160 return this;
163 } 161 }
164 162
165 void PermissionInfoBarDelegate::SetPermission(bool update_content_setting, 163 void PermissionInfoBarDelegate::SetPermission(bool update_content_setting,
166 PermissionAction decision) { 164 PermissionAction decision) {
167 action_taken_ = true; 165 action_taken_ = true;
168 callback_.Run(update_content_setting, decision); 166 callback_.Run(update_content_setting, decision);
169 } 167 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_context_base_unittest.cc ('k') | chrome/browser/permissions/permission_request_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698