Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 98463005: Enable/disable extensions upon changes in blacklist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 extension_service_->EnableExtension(extension_id); 1244 extension_service_->EnableExtension(extension_id);
1221 } else { 1245 } else {
1222 ExtensionErrorReporter::GetInstance()->ReportError( 1246 ExtensionErrorReporter::GetInstance()->ReportError(
1223 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1247 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1224 true /* be noisy */); 1248 true /* be noisy */);
1225 } 1249 }
1226 requirements_checker_.reset(); 1250 requirements_checker_.reset();
1227 } 1251 }
1228 1252
1229 } // namespace extensions 1253 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/resources/extensions/extensions.html ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698