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. |
214 base::DictionaryValue* extension_data = new base::DictionaryValue(); | 217 base::DictionaryValue* extension_data = new base::DictionaryValue(); |
215 bool enabled = extension_service_->IsExtensionEnabled(extension->id()); | 218 bool enabled = extension_service_->IsExtensionEnabled(extension->id()); |
216 GetExtensionBasicInfo(extension, enabled, extension_data); | 219 GetExtensionBasicInfo(extension, enabled, extension_data); |
217 | 220 |
218 ExtensionPrefs* prefs = ExtensionPrefs::Get(extension_service_->profile()); | 221 ExtensionPrefs* prefs = ExtensionPrefs::Get(extension_service_->profile()); |
219 int disable_reasons = prefs->GetDisableReasons(extension->id()); | 222 int disable_reasons = prefs->GetDisableReasons(extension->id()); |
220 | 223 |
221 bool suspicious_install = | 224 bool suspicious_install = |
222 (disable_reasons & Extension::DISABLE_NOT_VERIFIED) != 0; | 225 (disable_reasons & Extension::DISABLE_NOT_VERIFIED) != 0; |
223 extension_data->SetBoolean("suspiciousInstall", suspicious_install); | 226 extension_data->SetBoolean("suspiciousInstall", suspicious_install); |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 } | 811 } |
809 | 812 |
810 for (std::vector<const Extension*>::iterator iter = | 813 for (std::vector<const Extension*>::iterator iter = |
811 unpacked_extensions.begin(); iter != unpacked_extensions.end(); ++iter) { | 814 unpacked_extensions.begin(); iter != unpacked_extensions.end(); ++iter) { |
812 extension_service_->ReloadExtensionWithQuietFailure((*iter)->id()); | 815 extension_service_->ReloadExtensionWithQuietFailure((*iter)->id()); |
813 } | 816 } |
814 } | 817 } |
815 | 818 |
816 void ExtensionSettingsHandler::HandleRequestExtensionsData( | 819 void ExtensionSettingsHandler::HandleRequestExtensionsData( |
817 const base::ListValue* args) { | 820 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. |
818 base::DictionaryValue results; | 825 base::DictionaryValue results; |
819 | 826 |
820 Profile* profile = Profile::FromWebUI(web_ui()); | 827 Profile* profile = Profile::FromWebUI(web_ui()); |
821 | 828 |
822 // Add the extensions to the results structure. | 829 // Add the extensions to the results structure. |
823 base::ListValue* extensions_list = new base::ListValue(); | 830 base::ListValue* extensions_list = new base::ListValue(); |
824 | 831 |
825 ExtensionWarningService* warnings = | 832 ExtensionWarningService* warnings = |
826 ExtensionSystem::Get(profile)->warning_service(); | 833 ExtensionSystem::Get(profile)->warning_service(); |
827 | 834 |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 extension_service_->EnableExtension(extension_id); | 1415 extension_service_->EnableExtension(extension_id); |
1409 } else { | 1416 } else { |
1410 ExtensionErrorReporter::GetInstance()->ReportError( | 1417 ExtensionErrorReporter::GetInstance()->ReportError( |
1411 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1418 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1412 true); // Be noisy. | 1419 true); // Be noisy. |
1413 } | 1420 } |
1414 requirements_checker_.reset(); | 1421 requirements_checker_.reset(); |
1415 } | 1422 } |
1416 | 1423 |
1417 } // namespace extensions | 1424 } // namespace extensions |
OLD | NEW |