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/app_window.h" | 9 #include "apps/app_window.h" |
10 #include "apps/app_window_registry.h" | 10 #include "apps/app_window_registry.h" |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 extension != terminated_set.end(); ++extension) { | 803 extension != terminated_set.end(); ++extension) { |
804 if (ui_util::ShouldDisplayInExtensionSettings(*extension, profile)) { | 804 if (ui_util::ShouldDisplayInExtensionSettings(*extension, profile)) { |
805 extensions_list->Append(CreateExtensionDetailValue( | 805 extensions_list->Append(CreateExtensionDetailValue( |
806 extension->get(), | 806 extension->get(), |
807 empty_pages, // Terminated process has no active pages. | 807 empty_pages, // Terminated process has no active pages. |
808 warnings)); | 808 warnings)); |
809 } | 809 } |
810 } | 810 } |
811 results.Set("extensions", extensions_list); | 811 results.Set("extensions", extensions_list); |
812 | 812 |
813 bool is_managed = profile->IsManaged(); | 813 bool is_supervised = profile->IsSupervised(); |
814 bool developer_mode = | 814 bool developer_mode = |
815 !is_managed && | 815 !is_supervised && |
816 profile->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode); | 816 profile->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode); |
817 results.SetBoolean("profileIsManaged", is_managed); | 817 results.SetBoolean("profileIsManaged", is_supervised); |
818 results.SetBoolean("developerMode", developer_mode); | 818 results.SetBoolean("developerMode", developer_mode); |
819 | 819 |
820 // Promote the Chrome Apps & Extensions Developer Tools if they are not | 820 // Promote the Chrome Apps & Extensions Developer Tools if they are not |
821 // installed and the user has not previously dismissed the warning. | 821 // installed and the user has not previously dismissed the warning. |
822 bool promote_apps_dev_tools = false; | 822 bool promote_apps_dev_tools = false; |
823 if (!ExtensionRegistry::Get(Profile::FromWebUI(web_ui()))-> | 823 if (!ExtensionRegistry::Get(Profile::FromWebUI(web_ui()))-> |
824 GetExtensionById(kAppsDeveloperToolsExtensionId, | 824 GetExtensionById(kAppsDeveloperToolsExtensionId, |
825 ExtensionRegistry::EVERYTHING) && | 825 ExtensionRegistry::EVERYTHING) && |
826 !profile->GetPrefs()->GetBoolean(prefs::kExtensionsUIDismissedADTPromo)) { | 826 !profile->GetPrefs()->GetBoolean(prefs::kExtensionsUIDismissedADTPromo)) { |
827 promote_apps_dev_tools = true; | 827 promote_apps_dev_tools = true; |
(...skipping 14 matching lines...) Expand all Loading... |
842 should_do_verification_check_ = false; | 842 should_do_verification_check_ = false; |
843 ExtensionSystem::Get(Profile::FromWebUI(web_ui())) | 843 ExtensionSystem::Get(Profile::FromWebUI(web_ui())) |
844 ->install_verifier() | 844 ->install_verifier() |
845 ->VerifyAllExtensions(); | 845 ->VerifyAllExtensions(); |
846 } | 846 } |
847 } | 847 } |
848 | 848 |
849 void ExtensionSettingsHandler::HandleToggleDeveloperMode( | 849 void ExtensionSettingsHandler::HandleToggleDeveloperMode( |
850 const base::ListValue* args) { | 850 const base::ListValue* args) { |
851 Profile* profile = Profile::FromWebUI(web_ui()); | 851 Profile* profile = Profile::FromWebUI(web_ui()); |
852 if (profile->IsManaged()) | 852 if (profile->IsSupervised()) |
853 return; | 853 return; |
854 | 854 |
855 bool developer_mode = | 855 bool developer_mode = |
856 !profile->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode); | 856 !profile->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode); |
857 profile->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode, | 857 profile->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode, |
858 developer_mode); | 858 developer_mode); |
859 } | 859 } |
860 | 860 |
861 void ExtensionSettingsHandler::HandleInspectMessage( | 861 void ExtensionSettingsHandler::HandleInspectMessage( |
862 const base::ListValue* args) { | 862 const base::ListValue* args) { |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 extension_service_->EnableExtension(extension_id); | 1332 extension_service_->EnableExtension(extension_id); |
1333 } else { | 1333 } else { |
1334 ExtensionErrorReporter::GetInstance()->ReportError( | 1334 ExtensionErrorReporter::GetInstance()->ReportError( |
1335 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1335 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1336 true); // Be noisy. | 1336 true); // Be noisy. |
1337 } | 1337 } |
1338 requirements_checker_.reset(); | 1338 requirements_checker_.reset(); |
1339 } | 1339 } |
1340 | 1340 |
1341 } // namespace extensions | 1341 } // namespace extensions |
OLD | NEW |