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

Side by Side Diff: chrome/browser/chromeos/login/shutdown_button.cc

Issue 6452011: Rework tree APIs to reflect Google style and more const-correctness.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
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/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/cros/power_library.h"
10 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" 10 #include "chrome/browser/chromeos/login/rounded_rect_painter.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 gfx::Size button_size = GetPreferredSize(); 102 gfx::Size button_size = GetPreferredSize();
103 SetBounds( 103 SetBounds(
104 parent->width() - button_size.width()- kRightPadding, 104 parent->width() - button_size.width()- kRightPadding,
105 parent->height() - button_size.height() - kBottomPadding, 105 parent->height() - button_size.height() - kBottomPadding,
106 button_size.width(), 106 button_size.width(),
107 button_size.height()); 107 button_size.height());
108 } 108 }
109 109
110 void ShutdownButton::OnLocaleChanged() { 110 void ShutdownButton::OnLocaleChanged() {
111 SetText(UTF8ToWide(l10n_util::GetStringUTF8(IDS_SHUTDOWN_BUTTON))); 111 SetText(UTF8ToWide(l10n_util::GetStringUTF8(IDS_SHUTDOWN_BUTTON)));
112 if (GetParent()) { 112 if (parent()) {
113 GetParent()->Layout(); 113 parent()->Layout();
114 GetParent()->SchedulePaint(); 114 parent()->SchedulePaint();
115 } 115 }
116 } 116 }
117 117
118 gfx::NativeCursor ShutdownButton::GetCursorForPoint( 118 gfx::NativeCursor ShutdownButton::GetCursorForPoint(
119 views::Event::EventType event_type, 119 views::Event::EventType event_type,
120 const gfx::Point& p) { 120 const gfx::Point& p) {
121 if (!IsEnabled()) { 121 if (!IsEnabled()) {
122 return NULL; 122 return NULL;
123 } 123 }
124 return gfx::GetCursor(GDK_HAND2); 124 return gfx::GetCursor(GDK_HAND2);
125 } 125 }
126 126
127 void ShutdownButton::ButtonPressed(views::Button* sender, 127 void ShutdownButton::ButtonPressed(views::Button* sender,
128 const views::Event& event) { 128 const views::Event& event) {
129 DCHECK(CrosLibrary::Get()->EnsureLoaded()); 129 DCHECK(CrosLibrary::Get()->EnsureLoaded());
130 CrosLibrary::Get()->GetPowerLibrary()->RequestShutdown(); 130 CrosLibrary::Get()->GetPowerLibrary()->RequestShutdown();
131 } 131 }
132 132
133 } // namespace chromeos 133 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker.cc ('k') | chrome/browser/chromeos/login/user_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698