| 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 722 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 751   results.SetBoolean("developerMode", developer_mode); | 752   results.SetBoolean("developerMode", developer_mode); | 
| 752 | 753 | 
| 753   bool load_unpacked_disabled = | 754   bool load_unpacked_disabled = | 
| 754       extension_service_->extension_prefs()->ExtensionsBlacklistedByDefault(); | 755       extension_service_->extension_prefs()->ExtensionsBlacklistedByDefault(); | 
| 755   results.SetBoolean("loadUnpackedDisabled", load_unpacked_disabled); | 756   results.SetBoolean("loadUnpackedDisabled", load_unpacked_disabled); | 
| 756 | 757 | 
| 757   web_ui()->CallJavascriptFunction( | 758   web_ui()->CallJavascriptFunction( | 
| 758       "extensions.ExtensionSettings.returnExtensionsData", results); | 759       "extensions.ExtensionSettings.returnExtensionsData", results); | 
| 759 | 760 | 
| 760   MaybeRegisterForNotifications(); | 761   MaybeRegisterForNotifications(); | 
|  | 762   UMA_HISTOGRAM_BOOLEAN("ExtensionSettings.ShouldDoVerificationCheck", | 
|  | 763                         should_do_verification_check_); | 
| 761   if (should_do_verification_check_) { | 764   if (should_do_verification_check_) { | 
| 762     should_do_verification_check_ = false; | 765     should_do_verification_check_ = false; | 
| 763     extension_service_->VerifyAllExtensions(); | 766     extension_service_->VerifyAllExtensions(false);  // bootstrap=false. | 
| 764   } | 767   } | 
| 765 } | 768 } | 
| 766 | 769 | 
| 767 void ExtensionSettingsHandler::HandleToggleDeveloperMode( | 770 void ExtensionSettingsHandler::HandleToggleDeveloperMode( | 
| 768     const base::ListValue* args) { | 771     const base::ListValue* args) { | 
| 769   Profile* profile = Profile::FromWebUI(web_ui()); | 772   Profile* profile = Profile::FromWebUI(web_ui()); | 
| 770   if (profile->IsManaged()) | 773   if (profile->IsManaged()) | 
| 771     return; | 774     return; | 
| 772 | 775 | 
| 773   bool developer_mode = | 776   bool developer_mode = | 
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1244     extension_service_->EnableExtension(extension_id); | 1247     extension_service_->EnableExtension(extension_id); | 
| 1245   } else { | 1248   } else { | 
| 1246     ExtensionErrorReporter::GetInstance()->ReportError( | 1249     ExtensionErrorReporter::GetInstance()->ReportError( | 
| 1247         base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1250         base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 
| 1248         true /* be noisy */); | 1251         true /* be noisy */); | 
| 1249   } | 1252   } | 
| 1250   requirements_checker_.reset(); | 1253   requirements_checker_.reset(); | 
| 1251 } | 1254 } | 
| 1252 | 1255 | 
| 1253 }  // namespace extensions | 1256 }  // namespace extensions | 
| OLD | NEW | 
|---|