OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/extensions/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" |
6 | 6 |
7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
8 #include "apps/app_restore_service.h" | 8 #include "apps/app_restore_service.h" |
9 #include "apps/saved_files_service.h" | 9 #include "apps/saved_files_service.h" |
10 #include "apps/shell_window.h" | 10 #include "apps/shell_window.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #include "content/public/browser/notification_source.h" | 62 #include "content/public/browser/notification_source.h" |
63 #include "content/public/browser/notification_types.h" | 63 #include "content/public/browser/notification_types.h" |
64 #include "content/public/browser/render_process_host.h" | 64 #include "content/public/browser/render_process_host.h" |
65 #include "content/public/browser/render_view_host.h" | 65 #include "content/public/browser/render_view_host.h" |
66 #include "content/public/browser/site_instance.h" | 66 #include "content/public/browser/site_instance.h" |
67 #include "content/public/browser/user_metrics.h" | 67 #include "content/public/browser/user_metrics.h" |
68 #include "content/public/browser/web_contents.h" | 68 #include "content/public/browser/web_contents.h" |
69 #include "content/public/browser/web_contents_view.h" | 69 #include "content/public/browser/web_contents_view.h" |
70 #include "content/public/browser/web_ui.h" | 70 #include "content/public/browser/web_ui.h" |
71 #include "content/public/browser/web_ui_data_source.h" | 71 #include "content/public/browser/web_ui_data_source.h" |
| 72 #include "extensions/browser/blacklist_state.h" |
72 #include "extensions/browser/extension_error.h" | 73 #include "extensions/browser/extension_error.h" |
73 #include "extensions/browser/extension_registry.h" | 74 #include "extensions/browser/extension_registry.h" |
74 #include "extensions/browser/lazy_background_task_queue.h" | 75 #include "extensions/browser/lazy_background_task_queue.h" |
75 #include "extensions/browser/management_policy.h" | 76 #include "extensions/browser/management_policy.h" |
76 #include "extensions/browser/pref_names.h" | 77 #include "extensions/browser/pref_names.h" |
77 #include "extensions/browser/view_type_utils.h" | 78 #include "extensions/browser/view_type_utils.h" |
78 #include "extensions/common/constants.h" | 79 #include "extensions/common/constants.h" |
79 #include "extensions/common/extension.h" | 80 #include "extensions/common/extension.h" |
80 #include "extensions/common/extension_set.h" | 81 #include "extensions/common/extension_set.h" |
81 #include "extensions/common/feature_switch.h" | 82 #include "extensions/common/feature_switch.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } else if (extension->location() == Manifest::INTERNAL && | 250 } else if (extension->location() == Manifest::INTERNAL && |
250 !ManifestURL::UpdatesFromGallery(extension)) { | 251 !ManifestURL::UpdatesFromGallery(extension)) { |
251 location_text = l10n_util::GetStringUTF16( | 252 location_text = l10n_util::GetStringUTF16( |
252 IDS_OPTIONS_INSTALL_LOCATION_UNKNOWN); | 253 IDS_OPTIONS_INSTALL_LOCATION_UNKNOWN); |
253 } else if (extension->location() == Manifest::EXTERNAL_REGISTRY) { | 254 } else if (extension->location() == Manifest::EXTERNAL_REGISTRY) { |
254 location_text = l10n_util::GetStringUTF16( | 255 location_text = l10n_util::GetStringUTF16( |
255 IDS_OPTIONS_INSTALL_LOCATION_3RD_PARTY); | 256 IDS_OPTIONS_INSTALL_LOCATION_3RD_PARTY); |
256 } | 257 } |
257 extension_data->SetString("locationText", location_text); | 258 extension_data->SetString("locationText", location_text); |
258 | 259 |
| 260 base::string16 blacklist_text; |
| 261 switch (extension_service_->extension_prefs()->GetExtensionBlacklistState( |
| 262 extension->id())) { |
| 263 case BLACKLISTED_SECURITY_VULNERABILITY: |
| 264 blacklist_text = l10n_util::GetStringUTF16( |
| 265 IDS_OPTIONS_BLACKLISTED_SECURITY_VULNERABILITY); |
| 266 break; |
| 267 |
| 268 case BLACKLISTED_CWS_POLICY_VIOLATION: |
| 269 blacklist_text = l10n_util::GetStringUTF16( |
| 270 IDS_OPTIONS_BLACKLISTED_CWS_POLICY_VIOLATION); |
| 271 break; |
| 272 |
| 273 case BLACKLISTED_POTENTIALLY_UNWANTED: |
| 274 blacklist_text = l10n_util::GetStringUTF16( |
| 275 IDS_OPTIONS_BLACKLISTED_POTENTIALLY_UNWANTED); |
| 276 break; |
| 277 |
| 278 default: |
| 279 break; |
| 280 } |
| 281 extension_data->SetString("blacklistText", blacklist_text); |
| 282 |
259 // Force unpacked extensions to show at the top. | 283 // Force unpacked extensions to show at the top. |
260 if (Manifest::IsUnpackedLocation(extension->location())) | 284 if (Manifest::IsUnpackedLocation(extension->location())) |
261 extension_data->SetInteger("order", 1); | 285 extension_data->SetInteger("order", 1); |
262 else | 286 else |
263 extension_data->SetInteger("order", 2); | 287 extension_data->SetInteger("order", 2); |
264 | 288 |
265 if (!ExtensionActionAPI::GetBrowserActionVisibility( | 289 if (!ExtensionActionAPI::GetBrowserActionVisibility( |
266 extension_service_->extension_prefs(), extension->id())) { | 290 extension_service_->extension_prefs(), extension->id())) { |
267 extension_data->SetBoolean("enable_show_button", true); | 291 extension_data->SetBoolean("enable_show_button", true); |
268 } | 292 } |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 extension_service_->EnableExtension(extension_id); | 1243 extension_service_->EnableExtension(extension_id); |
1220 } else { | 1244 } else { |
1221 ExtensionErrorReporter::GetInstance()->ReportError( | 1245 ExtensionErrorReporter::GetInstance()->ReportError( |
1222 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1246 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1223 true /* be noisy */); | 1247 true /* be noisy */); |
1224 } | 1248 } |
1225 requirements_checker_.reset(); | 1249 requirements_checker_.reset(); |
1226 } | 1250 } |
1227 | 1251 |
1228 } // namespace extensions | 1252 } // namespace extensions |
OLD | NEW |