Chromium Code Reviews| 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 // b/chrome/browser/resources/extensions/extension_list.js in @typedef | |
|
Dan Beam
2014/08/22 21:57:13
remove b/
Vitaly Pavlenko
2014/08/23 00:59:03
Done.
| |
| 216 // for ExtensionData. Please update it whenever you add or remove any keys | |
| 217 // here. | |
| 214 base::DictionaryValue* extension_data = new base::DictionaryValue(); | 218 base::DictionaryValue* extension_data = new base::DictionaryValue(); |
| 215 bool enabled = extension_service_->IsExtensionEnabled(extension->id()); | 219 bool enabled = extension_service_->IsExtensionEnabled(extension->id()); |
| 216 GetExtensionBasicInfo(extension, enabled, extension_data); | 220 GetExtensionBasicInfo(extension, enabled, extension_data); |
| 217 | 221 |
| 218 ExtensionPrefs* prefs = ExtensionPrefs::Get(extension_service_->profile()); | 222 ExtensionPrefs* prefs = ExtensionPrefs::Get(extension_service_->profile()); |
| 219 int disable_reasons = prefs->GetDisableReasons(extension->id()); | 223 int disable_reasons = prefs->GetDisableReasons(extension->id()); |
| 220 | 224 |
| 221 bool suspicious_install = | 225 bool suspicious_install = |
| 222 (disable_reasons & Extension::DISABLE_NOT_VERIFIED) != 0; | 226 (disable_reasons & Extension::DISABLE_NOT_VERIFIED) != 0; |
| 223 extension_data->SetBoolean("suspiciousInstall", suspicious_install); | 227 extension_data->SetBoolean("suspiciousInstall", suspicious_install); |
| (...skipping 582 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 // chrome/browser/resources/extensions/extensions.js in @typedef for | |
| 822 // ExtensionRequest. Please update it whenever you add or remove any keys | |
| 823 // 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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1406 extension_service_->EnableExtension(extension_id); | 1414 extension_service_->EnableExtension(extension_id); |
| 1407 } else { | 1415 } else { |
| 1408 ExtensionErrorReporter::GetInstance()->ReportError( | 1416 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1409 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1417 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1410 true); // Be noisy. | 1418 true); // Be noisy. |
| 1411 } | 1419 } |
| 1412 requirements_checker_.reset(); | 1420 requirements_checker_.reset(); |
| 1413 } | 1421 } |
| 1414 | 1422 |
| 1415 } // namespace extensions | 1423 } // namespace extensions |
| OLD | NEW |