| 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" |  | 
|    20 #include "base/prefs/pref_service.h" |    19 #include "base/prefs/pref_service.h" | 
|    21 #include "base/strings/string_number_conversions.h" |    20 #include "base/strings/string_number_conversions.h" | 
|    22 #include "base/strings/string_util.h" |    21 #include "base/strings/string_util.h" | 
|    23 #include "base/strings/utf_string_conversions.h" |    22 #include "base/strings/utf_string_conversions.h" | 
|    24 #include "base/values.h" |    23 #include "base/values.h" | 
|    25 #include "base/version.h" |    24 #include "base/version.h" | 
|    26 #include "chrome/browser/browser_process.h" |    25 #include "chrome/browser/browser_process.h" | 
|    27 #include "chrome/browser/chrome_notification_types.h" |    26 #include "chrome/browser/chrome_notification_types.h" | 
|    28 #include "chrome/browser/devtools/devtools_window.h" |    27 #include "chrome/browser/devtools/devtools_window.h" | 
|    29 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |    28 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   752   results.SetBoolean("developerMode", developer_mode); |   751   results.SetBoolean("developerMode", developer_mode); | 
|   753  |   752  | 
|   754   bool load_unpacked_disabled = |   753   bool load_unpacked_disabled = | 
|   755       extension_service_->extension_prefs()->ExtensionsBlacklistedByDefault(); |   754       extension_service_->extension_prefs()->ExtensionsBlacklistedByDefault(); | 
|   756   results.SetBoolean("loadUnpackedDisabled", load_unpacked_disabled); |   755   results.SetBoolean("loadUnpackedDisabled", load_unpacked_disabled); | 
|   757  |   756  | 
|   758   web_ui()->CallJavascriptFunction( |   757   web_ui()->CallJavascriptFunction( | 
|   759       "extensions.ExtensionSettings.returnExtensionsData", results); |   758       "extensions.ExtensionSettings.returnExtensionsData", results); | 
|   760  |   759  | 
|   761   MaybeRegisterForNotifications(); |   760   MaybeRegisterForNotifications(); | 
|   762   UMA_HISTOGRAM_BOOLEAN("ExtensionSettings.ShouldDoVerificationCheck", |  | 
|   763                         should_do_verification_check_); |  | 
|   764   if (should_do_verification_check_) { |   761   if (should_do_verification_check_) { | 
|   765     should_do_verification_check_ = false; |   762     should_do_verification_check_ = false; | 
|   766     extension_service_->VerifyAllExtensions(false);  // bootstrap=false. |   763     extension_service_->VerifyAllExtensions(); | 
|   767   } |   764   } | 
|   768 } |   765 } | 
|   769  |   766  | 
|   770 void ExtensionSettingsHandler::HandleToggleDeveloperMode( |   767 void ExtensionSettingsHandler::HandleToggleDeveloperMode( | 
|   771     const base::ListValue* args) { |   768     const base::ListValue* args) { | 
|   772   Profile* profile = Profile::FromWebUI(web_ui()); |   769   Profile* profile = Profile::FromWebUI(web_ui()); | 
|   773   if (profile->IsManaged()) |   770   if (profile->IsManaged()) | 
|   774     return; |   771     return; | 
|   775  |   772  | 
|   776   bool developer_mode = |   773   bool developer_mode = | 
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1247     extension_service_->EnableExtension(extension_id); |  1244     extension_service_->EnableExtension(extension_id); | 
|  1248   } else { |  1245   } else { | 
|  1249     ExtensionErrorReporter::GetInstance()->ReportError( |  1246     ExtensionErrorReporter::GetInstance()->ReportError( | 
|  1250         base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |  1247         base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 
|  1251         true /* be noisy */); |  1248         true /* be noisy */); | 
|  1252   } |  1249   } | 
|  1253   requirements_checker_.reset(); |  1250   requirements_checker_.reset(); | 
|  1254 } |  1251 } | 
|  1255  |  1252  | 
|  1256 }  // namespace extensions |  1253 }  // namespace extensions | 
| OLD | NEW |