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

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

Issue 6329016: Screen Locker fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 11 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 ShutdownButton::ShutdownButton() 66 ShutdownButton::ShutdownButton()
67 : ALLOW_THIS_IN_INITIALIZER_LIST(TextButton(this, std::wstring())) { 67 : ALLOW_THIS_IN_INITIALIZER_LIST(TextButton(this, std::wstring())) {
68 } 68 }
69 69
70 void ShutdownButton::Init() { 70 void ShutdownButton::Init() {
71 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 71 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
72 SetIcon(*rb.GetBitmapNamed(IDR_SHUTDOWN_ICON)); 72 SetIcon(*rb.GetBitmapNamed(IDR_SHUTDOWN_ICON));
73 set_icon_text_spacing(kIconTextPadding); 73 set_icon_text_spacing(kIconTextPadding);
74 SetFocusable(true); 74 SetFocusable(true);
75 SetID(VIEW_ID_SCREEN_LOCKER_SHUTDOWN);
75 // Set label colors. 76 // Set label colors.
76 SetEnabledColor(SK_ColorWHITE); 77 SetEnabledColor(SK_ColorWHITE);
77 SetDisabledColor(SK_ColorWHITE); 78 SetDisabledColor(SK_ColorWHITE);
78 SetHighlightColor(SK_ColorWHITE); 79 SetHighlightColor(SK_ColorWHITE);
79 SetHoverColor(SK_ColorWHITE); 80 SetHoverColor(SK_ColorWHITE);
80 // Disable throbbing and make border always visible. 81 // Disable throbbing and make border always visible.
81 SetAnimationDuration(0); 82 SetAnimationDuration(0);
82 SetNormalHasBorder(true); 83 SetNormalHasBorder(true);
83 // Setup round shapes. 84 // Setup round shapes.
84 set_background( 85 set_background(
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 return gfx::GetCursor(GDK_HAND2); 124 return gfx::GetCursor(GDK_HAND2);
124 } 125 }
125 126
126 void ShutdownButton::ButtonPressed(views::Button* sender, 127 void ShutdownButton::ButtonPressed(views::Button* sender,
127 const views::Event& event) { 128 const views::Event& event) {
128 DCHECK(CrosLibrary::Get()->EnsureLoaded()); 129 DCHECK(CrosLibrary::Get()->EnsureLoaded());
129 CrosLibrary::Get()->GetPowerLibrary()->RequestShutdown(); 130 CrosLibrary::Get()->GetPowerLibrary()->RequestShutdown();
130 } 131 }
131 132
132 } // 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