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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 8537001: chromeos: Power manager client calls shutdown and restart (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased, changed to use EmptyResponseCallback Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chromeos/login/signin_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/task.h" 12 #include "base/task.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/browser_shutdown.h" 15 #include "chrome/browser/browser_shutdown.h"
16 #include "chrome/browser/chromeos/cros/cros_library.h" 16 #include "chrome/browser/chromeos/cros/cros_library.h"
17 #include "chrome/browser/chromeos/cros/network_library.h" 17 #include "chrome/browser/chromeos/cros/network_library.h"
18 #include "chrome/browser/chromeos/cros/power_library.h" 18 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
19 #include "chrome/browser/chromeos/dbus/power_manager_client.h"
19 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 20 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
20 #include "chrome/browser/chromeos/input_method/xkeyboard.h" 21 #include "chrome/browser/chromeos/input_method/xkeyboard.h"
21 #include "chrome/browser/chromeos/login/screen_locker.h" 22 #include "chrome/browser/chromeos/login/screen_locker.h"
22 #include "chrome/browser/chromeos/login/user.h" 23 #include "chrome/browser/chromeos/login/user.h"
23 #include "chrome/browser/chromeos/login/webui_login_display.h" 24 #include "chrome/browser/chromeos/login/webui_login_display.h"
24 #include "chrome/browser/chromeos/user_cros_settings_provider.h" 25 #include "chrome/browser/chromeos/user_cros_settings_provider.h"
25 #include "chrome/browser/io_thread.h" 26 #include "chrome/browser/io_thread.h"
26 #include "chrome/browser/profiles/profile.h" 27 #include "chrome/browser/profiles/profile.h"
27 #include "chrome/common/chrome_notification_types.h" 28 #include "chrome/common/chrome_notification_types.h"
28 #include "chrome/common/chrome_switches.h" 29 #include "chrome/common/chrome_switches.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 536
536 void SigninScreenHandler::HandleLaunchIncognito(const base::ListValue* args) { 537 void SigninScreenHandler::HandleLaunchIncognito(const base::ListValue* args) {
537 delegate_->LoginAsGuest(); 538 delegate_->LoginAsGuest();
538 } 539 }
539 540
540 void SigninScreenHandler::HandleFixCaptivePortal(const base::ListValue* args) { 541 void SigninScreenHandler::HandleFixCaptivePortal(const base::ListValue* args) {
541 delegate_->FixCaptivePortal(); 542 delegate_->FixCaptivePortal();
542 } 543 }
543 544
544 void SigninScreenHandler::HandleShutdownSystem(const base::ListValue* args) { 545 void SigninScreenHandler::HandleShutdownSystem(const base::ListValue* args) {
545 DCHECK(CrosLibrary::Get()->EnsureLoaded()); 546 DCHECK(CrosLibrary::Get()->EnsureLoaded());
satorux1 2011/11/11 19:03:31 Please remove this line.
Simon Que 2011/11/11 20:31:04 Done.
546 CrosLibrary::Get()->GetPowerLibrary()->RequestShutdown(); 547 DBusThreadManager::Get()->GetPowerManagerClient()->RequestShutdown();
547 } 548 }
548 549
549 void SigninScreenHandler::HandleRemoveUser(const base::ListValue* args) { 550 void SigninScreenHandler::HandleRemoveUser(const base::ListValue* args) {
550 std::string email; 551 std::string email;
551 if (!args->GetString(0, &email)) { 552 if (!args->GetString(0, &email)) {
552 NOTREACHED(); 553 NOTREACHED();
553 return; 554 return;
554 } 555 }
555 556
556 delegate_->RemoveUser(email); 557 delegate_->RemoveUser(email);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 725
725 cookie_remover_ = new BrowsingDataRemover( 726 cookie_remover_ = new BrowsingDataRemover(
726 Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()), 727 Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()),
727 BrowsingDataRemover::EVERYTHING, 728 BrowsingDataRemover::EVERYTHING,
728 base::Time()); 729 base::Time());
729 cookie_remover_->AddObserver(this); 730 cookie_remover_->AddObserver(this);
730 cookie_remover_->Remove(BrowsingDataRemover::REMOVE_SITE_DATA); 731 cookie_remover_->Remove(BrowsingDataRemover::REMOVE_SITE_DATA);
731 } 732 }
732 733
733 } // namespace chromeos 734 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698