| 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 const ExtensionSet* extensions = extension_service_->extensions(); | 774 const ExtensionSet* extensions = extension_service_->extensions(); |
| 775 std::vector<const Extension*> unpacked_extensions; | 775 std::vector<const Extension*> unpacked_extensions; |
| 776 for (ExtensionSet::const_iterator extension = extensions->begin(); | 776 for (ExtensionSet::const_iterator extension = extensions->begin(); |
| 777 extension != extensions->end(); ++extension) { | 777 extension != extensions->end(); ++extension) { |
| 778 if (Manifest::IsUnpackedLocation((*extension)->location())) | 778 if (Manifest::IsUnpackedLocation((*extension)->location())) |
| 779 unpacked_extensions.push_back(extension->get()); | 779 unpacked_extensions.push_back(extension->get()); |
| 780 } | 780 } |
| 781 | 781 |
| 782 for (std::vector<const Extension*>::iterator iter = | 782 for (std::vector<const Extension*>::iterator iter = |
| 783 unpacked_extensions.begin(); iter != unpacked_extensions.end(); ++iter) { | 783 unpacked_extensions.begin(); iter != unpacked_extensions.end(); ++iter) { |
| 784 extension_service_->ReloadExtension((*iter)->id()); | 784 extension_service_->ReloadExtensionWithQuietFailure((*iter)->id()); |
| 785 } | 785 } |
| 786 } | 786 } |
| 787 | 787 |
| 788 void ExtensionSettingsHandler::HandleRequestExtensionsData( | 788 void ExtensionSettingsHandler::HandleRequestExtensionsData( |
| 789 const base::ListValue* args) { | 789 const base::ListValue* args) { |
| 790 base::DictionaryValue results; | 790 base::DictionaryValue results; |
| 791 | 791 |
| 792 Profile* profile = Profile::FromWebUI(web_ui()); | 792 Profile* profile = Profile::FromWebUI(web_ui()); |
| 793 | 793 |
| 794 // Add the extensions to the results structure. | 794 // Add the extensions to the results structure. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 extension_service_->GetExtensionById(extension_id, false); | 926 extension_service_->GetExtensionById(extension_id, false); |
| 927 OpenApplication(AppLaunchParams(extension_service_->profile(), extension, | 927 OpenApplication(AppLaunchParams(extension_service_->profile(), extension, |
| 928 extensions::LAUNCH_CONTAINER_WINDOW, | 928 extensions::LAUNCH_CONTAINER_WINDOW, |
| 929 NEW_WINDOW)); | 929 NEW_WINDOW)); |
| 930 } | 930 } |
| 931 | 931 |
| 932 void ExtensionSettingsHandler::HandleReloadMessage( | 932 void ExtensionSettingsHandler::HandleReloadMessage( |
| 933 const base::ListValue* args) { | 933 const base::ListValue* args) { |
| 934 std::string extension_id = base::UTF16ToUTF8(ExtractStringValue(args)); | 934 std::string extension_id = base::UTF16ToUTF8(ExtractStringValue(args)); |
| 935 CHECK(!extension_id.empty()); | 935 CHECK(!extension_id.empty()); |
| 936 extension_service_->ReloadExtension(extension_id); | 936 extension_service_->ReloadExtensionWithQuietFailure(extension_id); |
| 937 } | 937 } |
| 938 | 938 |
| 939 void ExtensionSettingsHandler::HandleEnableMessage( | 939 void ExtensionSettingsHandler::HandleEnableMessage( |
| 940 const base::ListValue* args) { | 940 const base::ListValue* args) { |
| 941 CHECK_EQ(2U, args->GetSize()); | 941 CHECK_EQ(2U, args->GetSize()); |
| 942 std::string extension_id, enable_str; | 942 std::string extension_id, enable_str; |
| 943 CHECK(args->GetString(0, &extension_id)); | 943 CHECK(args->GetString(0, &extension_id)); |
| 944 CHECK(args->GetString(1, &enable_str)); | 944 CHECK(args->GetString(1, &enable_str)); |
| 945 | 945 |
| 946 const Extension* extension = | 946 const Extension* extension = |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 extension_service_->EnableExtension(extension_id); | 1366 extension_service_->EnableExtension(extension_id); |
| 1367 } else { | 1367 } else { |
| 1368 ExtensionErrorReporter::GetInstance()->ReportError( | 1368 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1369 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1369 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1370 true); // Be noisy. | 1370 true); // Be noisy. |
| 1371 } | 1371 } |
| 1372 requirements_checker_.reset(); | 1372 requirements_checker_.reset(); |
| 1373 } | 1373 } |
| 1374 | 1374 |
| 1375 } // namespace extensions | 1375 } // namespace extensions |
| OLD | NEW |