Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 15947007: Move application restart and relaunch code out of ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pafooey Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/auto_reset.h" 8 #include "base/auto_reset.h"
8 #include "base/base64.h" 9 #include "base/base64.h"
9 #include "base/bind.h" 10 #include "base/bind.h"
10 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
11 #include "base/command_line.h" 12 #include "base/command_line.h"
12 #include "base/prefs/pref_service.h" 13 #include "base/prefs/pref_service.h"
13 #include "base/string_util.h" 14 #include "base/string_util.h"
14 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
15 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
16 #include "base/values.h" 17 #include "base/values.h"
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 chrome::OpenApplication(chrome::AppLaunchParams(extension_service_->profile(), 669 chrome::OpenApplication(chrome::AppLaunchParams(extension_service_->profile(),
669 extension, 670 extension,
670 extension_misc::LAUNCH_WINDOW, 671 extension_misc::LAUNCH_WINDOW,
671 NEW_WINDOW)); 672 NEW_WINDOW));
672 } 673 }
673 674
674 void ExtensionSettingsHandler::HandleRestartMessage(const ListValue* args) { 675 void ExtensionSettingsHandler::HandleRestartMessage(const ListValue* args) {
675 CHECK_EQ(1U, args->GetSize()); 676 CHECK_EQ(1U, args->GetSize());
676 std::string extension_id; 677 std::string extension_id;
677 CHECK(args->GetString(0, &extension_id)); 678 CHECK(args->GetString(0, &extension_id));
678 extension_service_->RestartExtension(extension_id); 679 apps::AppLoadService::Get(extension_service_->profile())->RestartApplication(
680 extension_id);
679 } 681 }
680 682
681 void ExtensionSettingsHandler::HandleReloadMessage(const ListValue* args) { 683 void ExtensionSettingsHandler::HandleReloadMessage(const ListValue* args) {
682 std::string extension_id = UTF16ToUTF8(ExtractStringValue(args)); 684 std::string extension_id = UTF16ToUTF8(ExtractStringValue(args));
683 CHECK(!extension_id.empty()); 685 CHECK(!extension_id.empty());
684 extension_service_->ReloadExtension(extension_id); 686 extension_service_->ReloadExtension(extension_id);
685 } 687 }
686 688
687 void ExtensionSettingsHandler::HandleEnableMessage(const ListValue* args) { 689 void ExtensionSettingsHandler::HandleEnableMessage(const ListValue* args) {
688 CHECK_EQ(2U, args->GetSize()); 690 CHECK_EQ(2U, args->GetSize());
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 std::vector<std::string> requirement_errors) { 1042 std::vector<std::string> requirement_errors) {
1041 if (requirement_errors.empty()) { 1043 if (requirement_errors.empty()) {
1042 extension_service_->EnableExtension(extension_id); 1044 extension_service_->EnableExtension(extension_id);
1043 } else { 1045 } else {
1044 ExtensionErrorReporter::GetInstance()->ReportError( 1046 ExtensionErrorReporter::GetInstance()->ReportError(
1045 UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1047 UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1046 true /* be noisy */); 1048 true /* be noisy */);
1047 } 1049 }
1048 requirements_checker_.reset(); 1050 requirements_checker_.reset();
1049 } 1051 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698