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