| 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_window.h" | 8 #include "apps/app_window.h" |
| 9 #include "apps/app_window_registry.h" | 9 #include "apps/app_window_registry.h" |
| 10 #include "apps/saved_files_service.h" | 10 #include "apps/saved_files_service.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 registry->RegisterBooleanPref( | 204 registry->RegisterBooleanPref( |
| 205 prefs::kExtensionsUIDismissedADTPromo, | 205 prefs::kExtensionsUIDismissedADTPromo, |
| 206 false, | 206 false, |
| 207 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 207 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 208 } | 208 } |
| 209 | 209 |
| 210 base::DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue( | 210 base::DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue( |
| 211 const Extension* extension, | 211 const Extension* extension, |
| 212 const std::vector<ExtensionPage>& pages, | 212 const std::vector<ExtensionPage>& pages, |
| 213 const ExtensionWarningService* warning_service) { | 213 const ExtensionWarningService* warning_service) { |
| 214 // The items which are to be written into app_dict are also described in | |
| 215 // chrome/browser/resources/extensions/extension_list.js in @typedef for | |
| 216 // ExtensionData. Please update it whenever you add or remove any keys here. | |
| 217 base::DictionaryValue* extension_data = new base::DictionaryValue(); | 214 base::DictionaryValue* extension_data = new base::DictionaryValue(); |
| 218 bool enabled = extension_service_->IsExtensionEnabled(extension->id()); | 215 bool enabled = extension_service_->IsExtensionEnabled(extension->id()); |
| 219 GetExtensionBasicInfo(extension, enabled, extension_data); | 216 GetExtensionBasicInfo(extension, enabled, extension_data); |
| 220 | 217 |
| 221 ExtensionPrefs* prefs = ExtensionPrefs::Get(extension_service_->profile()); | 218 ExtensionPrefs* prefs = ExtensionPrefs::Get(extension_service_->profile()); |
| 222 int disable_reasons = prefs->GetDisableReasons(extension->id()); | 219 int disable_reasons = prefs->GetDisableReasons(extension->id()); |
| 223 | 220 |
| 224 bool suspicious_install = | 221 bool suspicious_install = |
| 225 (disable_reasons & Extension::DISABLE_NOT_VERIFIED) != 0; | 222 (disable_reasons & Extension::DISABLE_NOT_VERIFIED) != 0; |
| 226 extension_data->SetBoolean("suspiciousInstall", suspicious_install); | 223 extension_data->SetBoolean("suspiciousInstall", suspicious_install); |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 } | 808 } |
| 812 | 809 |
| 813 for (std::vector<const Extension*>::iterator iter = | 810 for (std::vector<const Extension*>::iterator iter = |
| 814 unpacked_extensions.begin(); iter != unpacked_extensions.end(); ++iter) { | 811 unpacked_extensions.begin(); iter != unpacked_extensions.end(); ++iter) { |
| 815 extension_service_->ReloadExtensionWithQuietFailure((*iter)->id()); | 812 extension_service_->ReloadExtensionWithQuietFailure((*iter)->id()); |
| 816 } | 813 } |
| 817 } | 814 } |
| 818 | 815 |
| 819 void ExtensionSettingsHandler::HandleRequestExtensionsData( | 816 void ExtensionSettingsHandler::HandleRequestExtensionsData( |
| 820 const base::ListValue* args) { | 817 const base::ListValue* args) { |
| 821 // The items which are to be written into results are also described in | |
| 822 // chrome/browser/resources/extensions/extensions.js in @typedef for | |
| 823 // ExtensionDataResponse. Please update it whenever you add or remove any keys | |
| 824 // here. | |
| 825 base::DictionaryValue results; | 818 base::DictionaryValue results; |
| 826 | 819 |
| 827 Profile* profile = Profile::FromWebUI(web_ui()); | 820 Profile* profile = Profile::FromWebUI(web_ui()); |
| 828 | 821 |
| 829 // Add the extensions to the results structure. | 822 // Add the extensions to the results structure. |
| 830 base::ListValue* extensions_list = new base::ListValue(); | 823 base::ListValue* extensions_list = new base::ListValue(); |
| 831 | 824 |
| 832 ExtensionWarningService* warnings = | 825 ExtensionWarningService* warnings = |
| 833 ExtensionSystem::Get(profile)->warning_service(); | 826 ExtensionSystem::Get(profile)->warning_service(); |
| 834 | 827 |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1415 extension_service_->EnableExtension(extension_id); | 1408 extension_service_->EnableExtension(extension_id); |
| 1416 } else { | 1409 } else { |
| 1417 ExtensionErrorReporter::GetInstance()->ReportError( | 1410 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1418 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1411 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1419 true); // Be noisy. | 1412 true); // Be noisy. |
| 1420 } | 1413 } |
| 1421 requirements_checker_.reset(); | 1414 requirements_checker_.reset(); |
| 1422 } | 1415 } |
| 1423 | 1416 |
| 1424 } // namespace extensions | 1417 } // namespace extensions |
| OLD | NEW |