| 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/content_settings/permission_bubble_request_impl.h" | 5 #include "chrome/browser/content_settings/permission_bubble_request_impl.h" |
| 6 | 6 |
| 7 #include "chrome/browser/content_settings/permission_context_base.h" | 7 #include "chrome/browser/content_settings/permission_context_base.h" |
| 8 #include "chrome/browser/content_settings/permission_context_uma_util.h" | 8 #include "chrome/browser/content_settings/permission_context_uma_util.h" |
| 9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
| 10 #include "grit/theme_resources.h" | 10 #include "grit/theme_resources.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 is_finished_(false), | 27 is_finished_(false), |
| 28 action_taken_(false) { | 28 action_taken_(false) { |
| 29 } | 29 } |
| 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 PermissionContextUmaUtil::PermissionIgnored(type_); | 34 PermissionContextUmaUtil::PermissionIgnored(type_); |
| 35 } | 35 } |
| 36 | 36 |
| 37 PermissionBubbleRequest::Type PermissionBubbleRequestImpl::GetType() const { |
| 38 return PermissionBubbleRequest::Type::kOther; |
| 39 } |
| 40 |
| 37 int PermissionBubbleRequestImpl::GetIconID() const { | 41 int PermissionBubbleRequestImpl::GetIconID() const { |
| 38 int icon_id; | 42 int icon_id; |
| 39 switch (type_) { | 43 switch (type_) { |
| 40 #if defined(ENABLE_NOTIFICATIONS) | 44 #if defined(ENABLE_NOTIFICATIONS) |
| 41 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | 45 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
| 42 icon_id = IDR_INFOBAR_DESKTOP_NOTIFICATIONS; | 46 icon_id = IDR_INFOBAR_DESKTOP_NOTIFICATIONS; |
| 43 break; | 47 break; |
| 44 #endif | 48 #endif |
| 45 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: | 49 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: |
| 46 icon_id = IDR_ALLOWED_MIDI_SYSEX; | 50 icon_id = IDR_ALLOWED_MIDI_SYSEX; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 126 |
| 123 void PermissionBubbleRequestImpl::Cancelled() { | 127 void PermissionBubbleRequestImpl::Cancelled() { |
| 124 RegisterActionTaken(); | 128 RegisterActionTaken(); |
| 125 permission_decided_callback_.Run(false, false); | 129 permission_decided_callback_.Run(false, false); |
| 126 } | 130 } |
| 127 | 131 |
| 128 void PermissionBubbleRequestImpl::RequestFinished() { | 132 void PermissionBubbleRequestImpl::RequestFinished() { |
| 129 is_finished_ = true; | 133 is_finished_ = true; |
| 130 delete_callback_.Run(); | 134 delete_callback_.Run(); |
| 131 } | 135 } |
| OLD | NEW |