Chromium Code Reviews| 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" |
| 11 #include "apps/shell_window_registry.h" | 11 #include "apps/shell_window_registry.h" |
| 12 #include "base/auto_reset.h" | 12 #include "base/auto_reset.h" |
| 13 #include "base/base64.h" | 13 #include "base/base64.h" |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/bind_helpers.h" | 15 #include "base/bind_helpers.h" |
| 16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 17 #include "base/location.h" | 17 #include "base/location.h" |
| 18 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
| 19 #include "base/metrics/histogram.h" | |
| 19 #include "base/prefs/pref_service.h" | 20 #include "base/prefs/pref_service.h" |
| 20 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 21 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 22 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
| 23 #include "base/values.h" | 24 #include "base/values.h" |
| 24 #include "base/version.h" | 25 #include "base/version.h" |
| 25 #include "chrome/browser/browser_process.h" | 26 #include "chrome/browser/browser_process.h" |
| 26 #include "chrome/browser/chrome_notification_types.h" | 27 #include "chrome/browser/chrome_notification_types.h" |
| 27 #include "chrome/browser/devtools/devtools_window.h" | 28 #include "chrome/browser/devtools/devtools_window.h" |
| 28 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 29 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 results.SetBoolean("developerMode", developer_mode); | 728 results.SetBoolean("developerMode", developer_mode); |
| 728 | 729 |
| 729 bool load_unpacked_disabled = | 730 bool load_unpacked_disabled = |
| 730 extension_service_->extension_prefs()->ExtensionsBlacklistedByDefault(); | 731 extension_service_->extension_prefs()->ExtensionsBlacklistedByDefault(); |
| 731 results.SetBoolean("loadUnpackedDisabled", load_unpacked_disabled); | 732 results.SetBoolean("loadUnpackedDisabled", load_unpacked_disabled); |
| 732 | 733 |
| 733 web_ui()->CallJavascriptFunction( | 734 web_ui()->CallJavascriptFunction( |
| 734 "extensions.ExtensionSettings.returnExtensionsData", results); | 735 "extensions.ExtensionSettings.returnExtensionsData", results); |
| 735 | 736 |
| 736 MaybeRegisterForNotifications(); | 737 MaybeRegisterForNotifications(); |
| 738 UMA_HISTOGRAM_BOOLEAN("ExtensionSettings.ShouldDoVerificationCheck", | |
| 739 should_do_verification_check_); | |
| 737 if (should_do_verification_check_) { | 740 if (should_do_verification_check_) { |
| 738 should_do_verification_check_ = false; | 741 should_do_verification_check_ = false; |
| 739 extension_service_->VerifyAllExtensions(); | 742 extension_service_->VerifyAllExtensions(false /*bootstrap*/); |
|
Finnur
2014/01/29 10:35:42
nit: Ditto.
asargent_no_longer_on_chrome
2014/01/29 19:52:51
Done.
| |
| 740 } | 743 } |
| 741 } | 744 } |
| 742 | 745 |
| 743 void ExtensionSettingsHandler::HandleToggleDeveloperMode( | 746 void ExtensionSettingsHandler::HandleToggleDeveloperMode( |
| 744 const base::ListValue* args) { | 747 const base::ListValue* args) { |
| 745 Profile* profile = Profile::FromWebUI(web_ui()); | 748 Profile* profile = Profile::FromWebUI(web_ui()); |
| 746 if (profile->IsManaged()) | 749 if (profile->IsManaged()) |
| 747 return; | 750 return; |
| 748 | 751 |
| 749 bool developer_mode = | 752 bool developer_mode = |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1219 extension_service_->EnableExtension(extension_id); | 1222 extension_service_->EnableExtension(extension_id); |
| 1220 } else { | 1223 } else { |
| 1221 ExtensionErrorReporter::GetInstance()->ReportError( | 1224 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1222 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1225 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1223 true /* be noisy */); | 1226 true /* be noisy */); |
| 1224 } | 1227 } |
| 1225 requirements_checker_.reset(); | 1228 requirements_checker_.reset(); |
| 1226 } | 1229 } |
| 1227 | 1230 |
| 1228 } // namespace extensions | 1231 } // namespace extensions |
| OLD | NEW |