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_request_impl.h" | 5 #include "chrome/browser/permissions/permission_request_impl.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "chrome/browser/permissions/permission_decision_auto_blocker.h" | 8 #include "chrome/browser/permissions/permission_decision_auto_blocker.h" |
9 #include "chrome/browser/permissions/permission_uma_util.h" | 9 #include "chrome/browser/permissions/permission_uma_util.h" |
10 #include "chrome/browser/permissions/permission_util.h" | 10 #include "chrome/browser/permissions/permission_util.h" |
11 #include "chrome/grit/generated_resources.h" | 11 #include "chrome/grit/generated_resources.h" |
12 #include "chrome/grit/theme_resources.h" | 12 #include "chrome/grit/theme_resources.h" |
| 13 #include "components/strings/grit/components_strings.h" |
13 #include "components/url_formatter/elide_url.h" | 14 #include "components/url_formatter/elide_url.h" |
14 #include "net/base/escape.h" | 15 #include "net/base/escape.h" |
15 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
16 | 17 |
17 #if defined(OS_ANDROID) | 18 #if defined(OS_ANDROID) |
18 #include "chrome/browser/android/android_theme_resources.h" | 19 #include "chrome/browser/android/android_theme_resources.h" |
19 #else | 20 #else |
20 #include "chrome/app/vector_icons/vector_icons.h" | 21 #include "chrome/app/vector_icons/vector_icons.h" |
21 #include "ui/vector_icons/vector_icons.h" | 22 #include "ui/vector_icons/vector_icons.h" |
22 #endif | 23 #endif |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 return kProductIcon; | 87 return kProductIcon; |
87 #endif | 88 #endif |
88 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: | 89 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: |
89 return ui::kMidiIcon; | 90 return ui::kMidiIcon; |
90 case CONTENT_SETTINGS_TYPE_PLUGINS: | 91 case CONTENT_SETTINGS_TYPE_PLUGINS: |
91 return kExtensionIcon; | 92 return kExtensionIcon; |
92 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: | 93 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: |
93 return ui::kMicrophoneIcon; | 94 return ui::kMicrophoneIcon; |
94 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: | 95 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: |
95 return ui::kVideocamIcon; | 96 return ui::kVideocamIcon; |
| 97 case CONTENT_SETTINGS_TYPE_PAYMENT_HANDLER: |
| 98 return kProductIcon; |
96 default: | 99 default: |
97 NOTREACHED(); | 100 NOTREACHED(); |
98 return kExtensionIcon; | 101 return kExtensionIcon; |
99 } | 102 } |
100 #endif | 103 #endif |
101 } | 104 } |
102 | 105 |
103 #if defined(OS_ANDROID) | 106 #if defined(OS_ANDROID) |
104 base::string16 PermissionRequestImpl::GetMessageText() const { | 107 base::string16 PermissionRequestImpl::GetMessageText() const { |
105 int message_id; | 108 int message_id; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 #endif | 157 #endif |
155 case CONTENT_SETTINGS_TYPE_PLUGINS: | 158 case CONTENT_SETTINGS_TYPE_PLUGINS: |
156 message_id = IDS_FLASH_PERMISSION_FRAGMENT; | 159 message_id = IDS_FLASH_PERMISSION_FRAGMENT; |
157 break; | 160 break; |
158 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: | 161 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: |
159 message_id = IDS_MEDIA_CAPTURE_AUDIO_ONLY_PERMISSION_FRAGMENT; | 162 message_id = IDS_MEDIA_CAPTURE_AUDIO_ONLY_PERMISSION_FRAGMENT; |
160 break; | 163 break; |
161 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: | 164 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: |
162 message_id = IDS_MEDIA_CAPTURE_VIDEO_ONLY_PERMISSION_FRAGMENT; | 165 message_id = IDS_MEDIA_CAPTURE_VIDEO_ONLY_PERMISSION_FRAGMENT; |
163 break; | 166 break; |
| 167 case CONTENT_SETTINGS_TYPE_PAYMENT_HANDLER: |
| 168 message_id = IDS_PAYMENTS_PAYMENT_HANDLER_REQUEST_PERMISSION; |
| 169 break; |
164 default: | 170 default: |
165 NOTREACHED(); | 171 NOTREACHED(); |
166 return base::string16(); | 172 return base::string16(); |
167 } | 173 } |
168 return l10n_util::GetStringUTF16(message_id); | 174 return l10n_util::GetStringUTF16(message_id); |
169 } | 175 } |
170 | 176 |
171 GURL PermissionRequestImpl::GetOrigin() const { | 177 GURL PermissionRequestImpl::GetOrigin() const { |
172 return request_origin_; | 178 return request_origin_; |
173 } | 179 } |
(...skipping 28 matching lines...) Expand all Loading... |
202 } | 208 } |
203 | 209 |
204 PermissionRequestGestureType PermissionRequestImpl::GetGestureType() | 210 PermissionRequestGestureType PermissionRequestImpl::GetGestureType() |
205 const { | 211 const { |
206 return PermissionUtil::GetGestureType(has_gesture_); | 212 return PermissionUtil::GetGestureType(has_gesture_); |
207 } | 213 } |
208 | 214 |
209 ContentSettingsType PermissionRequestImpl::GetContentSettingsType() const { | 215 ContentSettingsType PermissionRequestImpl::GetContentSettingsType() const { |
210 return content_settings_type_; | 216 return content_settings_type_; |
211 } | 217 } |
OLD | NEW |