| 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 14 matching lines...) Expand all Loading... |
| 25 profile_(profile), | 25 profile_(profile), |
| 26 permission_decided_callback_(permission_decided_callback), | 26 permission_decided_callback_(permission_decided_callback), |
| 27 delete_callback_(delete_callback), | 27 delete_callback_(delete_callback), |
| 28 is_finished_(false), | 28 is_finished_(false), |
| 29 action_taken_(false) {} | 29 action_taken_(false) {} |
| 30 | 30 |
| 31 PermissionBubbleRequestImpl::~PermissionBubbleRequestImpl() { | 31 PermissionBubbleRequestImpl::~PermissionBubbleRequestImpl() { |
| 32 DCHECK(is_finished_); | 32 DCHECK(is_finished_); |
| 33 if (!action_taken_) | 33 if (!action_taken_) |
| 34 PermissionUmaUtil::PermissionIgnored(permission_type_, request_origin_, | 34 PermissionUmaUtil::PermissionIgnored(permission_type_, request_origin_, |
| 35 profile_); | 35 PROMPT, profile_); |
| 36 } | 36 } |
| 37 | 37 |
| 38 gfx::VectorIconId PermissionBubbleRequestImpl::GetVectorIconId() const { | 38 gfx::VectorIconId PermissionBubbleRequestImpl::GetVectorIconId() const { |
| 39 #if !defined(OS_MACOSX) | 39 #if !defined(OS_MACOSX) |
| 40 switch (permission_type_) { | 40 switch (permission_type_) { |
| 41 case content::PermissionType::GEOLOCATION: | 41 case content::PermissionType::GEOLOCATION: |
| 42 return gfx::VectorIconId::LOCATION_ON; | 42 return gfx::VectorIconId::LOCATION_ON; |
| 43 #if defined(ENABLE_NOTIFICATIONS) | 43 #if defined(ENABLE_NOTIFICATIONS) |
| 44 case content::PermissionType::NOTIFICATIONS: | 44 case content::PermissionType::NOTIFICATIONS: |
| 45 return gfx::VectorIconId::NOTIFICATIONS; | 45 return gfx::VectorIconId::NOTIFICATIONS; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 return PermissionBubbleType::PERMISSION_PUSH_MESSAGING; | 150 return PermissionBubbleType::PERMISSION_PUSH_MESSAGING; |
| 151 #if defined(OS_CHROMEOS) | 151 #if defined(OS_CHROMEOS) |
| 152 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: | 152 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: |
| 153 return PermissionBubbleType::PERMISSION_PROTECTED_MEDIA_IDENTIFIER; | 153 return PermissionBubbleType::PERMISSION_PROTECTED_MEDIA_IDENTIFIER; |
| 154 #endif | 154 #endif |
| 155 default: | 155 default: |
| 156 NOTREACHED(); | 156 NOTREACHED(); |
| 157 return PermissionBubbleType::UNKNOWN; | 157 return PermissionBubbleType::UNKNOWN; |
| 158 } | 158 } |
| 159 } | 159 } |
| OLD | NEW |