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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 registry->RegisterBooleanPref( | 203 registry->RegisterBooleanPref( |
204 prefs::kExtensionsUIDismissedADTPromo, | 204 prefs::kExtensionsUIDismissedADTPromo, |
205 false, | 205 false, |
206 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 206 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
207 } | 207 } |
208 | 208 |
209 base::DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue( | 209 base::DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue( |
210 const Extension* extension, | 210 const Extension* extension, |
211 const std::vector<ExtensionPage>& pages, | 211 const std::vector<ExtensionPage>& pages, |
212 const ExtensionWarningService* warning_service) { | 212 const ExtensionWarningService* warning_service) { |
213 // The items which are to be written into app_dict are also described in | |
214 // b/chrome/browser/resources/extensions/extension_list.js in @typedef | |
Dan Beam
2014/08/21 18:27:48
remove b/
Vitaly Pavlenko
2014/08/22 01:43:41
Done.
Dan Beam
2014/08/22 21:57:13
not done
| |
215 // for BackendExtensionDataObject. Please update it whenever you add or remove | |
216 // any keys here. | |
213 base::DictionaryValue* extension_data = new base::DictionaryValue(); | 217 base::DictionaryValue* extension_data = new base::DictionaryValue(); |
214 bool enabled = extension_service_->IsExtensionEnabled(extension->id()); | 218 bool enabled = extension_service_->IsExtensionEnabled(extension->id()); |
215 GetExtensionBasicInfo(extension, enabled, extension_data); | 219 GetExtensionBasicInfo(extension, enabled, extension_data); |
216 | 220 |
217 ExtensionPrefs* prefs = ExtensionPrefs::Get(extension_service_->profile()); | 221 ExtensionPrefs* prefs = ExtensionPrefs::Get(extension_service_->profile()); |
218 int disable_reasons = prefs->GetDisableReasons(extension->id()); | 222 int disable_reasons = prefs->GetDisableReasons(extension->id()); |
219 | 223 |
220 bool suspicious_install = | 224 bool suspicious_install = |
221 (disable_reasons & Extension::DISABLE_NOT_VERIFIED) != 0; | 225 (disable_reasons & Extension::DISABLE_NOT_VERIFIED) != 0; |
222 extension_data->SetBoolean("suspiciousInstall", suspicious_install); | 226 extension_data->SetBoolean("suspiciousInstall", suspicious_install); |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
806 } | 810 } |
807 | 811 |
808 for (std::vector<const Extension*>::iterator iter = | 812 for (std::vector<const Extension*>::iterator iter = |
809 unpacked_extensions.begin(); iter != unpacked_extensions.end(); ++iter) { | 813 unpacked_extensions.begin(); iter != unpacked_extensions.end(); ++iter) { |
810 extension_service_->ReloadExtensionWithQuietFailure((*iter)->id()); | 814 extension_service_->ReloadExtensionWithQuietFailure((*iter)->id()); |
811 } | 815 } |
812 } | 816 } |
813 | 817 |
814 void ExtensionSettingsHandler::HandleRequestExtensionsData( | 818 void ExtensionSettingsHandler::HandleRequestExtensionsData( |
815 const base::ListValue* args) { | 819 const base::ListValue* args) { |
820 // The items which are to be written into results are also described in | |
821 // b/chrome/browser/resources/extensions/extensions.js in @typedef | |
822 // for BackendExtensionsDataObject. Please update it whenever you add or | |
823 // remove any keys here. | |
816 base::DictionaryValue results; | 824 base::DictionaryValue results; |
817 | 825 |
818 Profile* profile = Profile::FromWebUI(web_ui()); | 826 Profile* profile = Profile::FromWebUI(web_ui()); |
819 | 827 |
820 // Add the extensions to the results structure. | 828 // Add the extensions to the results structure. |
821 base::ListValue* extensions_list = new base::ListValue(); | 829 base::ListValue* extensions_list = new base::ListValue(); |
822 | 830 |
823 ExtensionWarningService* warnings = | 831 ExtensionWarningService* warnings = |
824 ExtensionSystem::Get(profile)->warning_service(); | 832 ExtensionSystem::Get(profile)->warning_service(); |
825 | 833 |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1402 extension_service_->EnableExtension(extension_id); | 1410 extension_service_->EnableExtension(extension_id); |
1403 } else { | 1411 } else { |
1404 ExtensionErrorReporter::GetInstance()->ReportError( | 1412 ExtensionErrorReporter::GetInstance()->ReportError( |
1405 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1413 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1406 true); // Be noisy. | 1414 true); // Be noisy. |
1407 } | 1415 } |
1408 requirements_checker_.reset(); | 1416 requirements_checker_.reset(); |
1409 } | 1417 } |
1410 | 1418 |
1411 } // namespace extensions | 1419 } // namespace extensions |
OLD | NEW |