OLD | NEW |
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/chromeos/login/shutdown_button.h" | 5 #include "chrome/browser/chromeos/login/shutdown_button.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/chromeos/cros/cros_library.h" | 8 #include "chrome/browser/chromeos/cros/cros_library.h" |
9 #include "chrome/browser/chromeos/cros/power_library.h" | 9 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 10 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
10 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 11 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
11 #include "chrome/browser/chromeos/view_ids.h" | 12 #include "chrome/browser/chromeos/view_ids.h" |
12 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
13 #include "grit/theme_resources.h" | 14 #include "grit/theme_resources.h" |
14 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
15 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
16 #include "ui/gfx/gtk_util.h" | 17 #include "ui/gfx/gtk_util.h" |
17 #include "views/background.h" | 18 #include "views/background.h" |
18 | 19 |
19 namespace { | 20 namespace { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 void ShutdownButton::OnLocaleChanged() { | 108 void ShutdownButton::OnLocaleChanged() { |
108 SetText(l10n_util::GetStringUTF16(IDS_SHUTDOWN_BUTTON)); | 109 SetText(l10n_util::GetStringUTF16(IDS_SHUTDOWN_BUTTON)); |
109 if (parent()) { | 110 if (parent()) { |
110 parent()->Layout(); | 111 parent()->Layout(); |
111 parent()->SchedulePaint(); | 112 parent()->SchedulePaint(); |
112 } | 113 } |
113 } | 114 } |
114 | 115 |
115 void ShutdownButton::ButtonPressed(views::Button* sender, | 116 void ShutdownButton::ButtonPressed(views::Button* sender, |
116 const views::Event& event) { | 117 const views::Event& event) { |
117 DCHECK(CrosLibrary::Get()->EnsureLoaded()); | 118 DBusThreadManager::Get()->GetPowerManagerClient()->RequestShutdown(); |
118 CrosLibrary::Get()->GetPowerLibrary()->RequestShutdown(); | |
119 } | 119 } |
120 | 120 |
121 } // namespace chromeos | 121 } // namespace chromeos |
OLD | NEW |