| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 break; | 100 break; |
| 101 #if defined(OS_CHROMEOS) | 101 #if defined(OS_CHROMEOS) |
| 102 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: | 102 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: |
| 103 message_id = IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION; | 103 message_id = IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION; |
| 104 break; | 104 break; |
| 105 #endif | 105 #endif |
| 106 default: | 106 default: |
| 107 NOTREACHED(); | 107 NOTREACHED(); |
| 108 return base::string16(); | 108 return base::string16(); |
| 109 } | 109 } |
| 110 return l10n_util::GetStringFUTF16(message_id, | 110 return l10n_util::GetStringFUTF16( |
| 111 url_formatter::FormatUrlForSecurityDisplay( | 111 message_id, url_formatter::FormatUrlForSecurityDisplayOmitScheme( |
| 112 request_origin_, display_languages_)); | 112 request_origin_, display_languages_)); |
| 113 } | 113 } |
| 114 | 114 |
| 115 base::string16 PermissionBubbleRequestImpl::GetMessageTextFragment() const { | 115 base::string16 PermissionBubbleRequestImpl::GetMessageTextFragment() const { |
| 116 int message_id; | 116 int message_id; |
| 117 switch (permission_type_) { | 117 switch (permission_type_) { |
| 118 case content::PermissionType::GEOLOCATION: | 118 case content::PermissionType::GEOLOCATION: |
| 119 message_id = IDS_GEOLOCATION_INFOBAR_PERMISSION_FRAGMENT; | 119 message_id = IDS_GEOLOCATION_INFOBAR_PERMISSION_FRAGMENT; |
| 120 break; | 120 break; |
| 121 #if defined(ENABLE_NOTIFICATIONS) | 121 #if defined(ENABLE_NOTIFICATIONS) |
| 122 case content::PermissionType::NOTIFICATIONS: | 122 case content::PermissionType::NOTIFICATIONS: |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 void PermissionBubbleRequestImpl::Cancelled() { | 158 void PermissionBubbleRequestImpl::Cancelled() { |
| 159 RegisterActionTaken(); | 159 RegisterActionTaken(); |
| 160 permission_decided_callback_.Run(false, CONTENT_SETTING_DEFAULT); | 160 permission_decided_callback_.Run(false, CONTENT_SETTING_DEFAULT); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void PermissionBubbleRequestImpl::RequestFinished() { | 163 void PermissionBubbleRequestImpl::RequestFinished() { |
| 164 is_finished_ = true; | 164 is_finished_ = true; |
| 165 delete_callback_.Run(); | 165 delete_callback_.Run(); |
| 166 } | 166 } |
| OLD | NEW |