OLD | NEW |
---|---|
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_bubble_request_impl.h" | 5 #include "chrome/browser/permissions/permission_bubble_request_impl.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "chrome/browser/permissions/permission_context_base.h" | 8 #include "chrome/browser/permissions/permission_context_base.h" |
9 #include "chrome/browser/permissions/permission_uma_util.h" | 9 #include "chrome/browser/permissions/permission_uma_util.h" |
10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 permission_decided_callback_.Run(false, CONTENT_SETTING_DEFAULT); | 159 permission_decided_callback_.Run(false, CONTENT_SETTING_DEFAULT); |
160 } | 160 } |
161 | 161 |
162 void PermissionBubbleRequestImpl::RequestFinished() { | 162 void PermissionBubbleRequestImpl::RequestFinished() { |
163 is_finished_ = true; | 163 is_finished_ = true; |
164 delete_callback_.Run(); | 164 delete_callback_.Run(); |
165 } | 165 } |
166 | 166 |
167 PermissionBubbleType PermissionBubbleRequestImpl::GetPermissionBubbleType() | 167 PermissionBubbleType PermissionBubbleRequestImpl::GetPermissionBubbleType() |
168 const { | 168 const { |
169 return PermissionBubbleType::PERMISSION; | 169 switch (permission_type_) { |
170 case content::PermissionType::GEOLOCATION: | |
171 return PermissionBubbleType::PERMISSION_GEOLOCATION; | |
172 #if defined(ENABLE_NOTIFICATIONS) | |
173 case content::PermissionType::NOTIFICATIONS: | |
174 return PermissionBubbleType::PERMISSION_NOTIFICATIONS; | |
175 #endif | |
176 case content::PermissionType::MIDI_SYSEX: | |
177 return PermissionBubbleType::PERMISSION_MIDI_SYSEX; | |
178 case content::PermissionType::PUSH_MESSAGING: | |
179 return PermissionBubbleType::PERMISSION_PUSH_MESSAGING; | |
180 #if defined(OS_CHROMEOS) | |
181 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: | |
182 return PermissionBubbleType::PERMISSION_PROTECTED_MEDIA_IDENTIFIER; | |
183 #endif | |
184 default: | |
185 NOTREACHED(); | |
186 return PermissionBubbleType::UNKNOWN; | |
felt
2016/04/27 15:37:24
weird to have a return after a NOTREACHED()?
benwells
2016/04/28 00:16:59
To compile the function has to return something, p
| |
187 } | |
170 } | 188 } |
OLD | NEW |