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/cros/power_library.h" |
10 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 10 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
11 #include "chrome/browser/chromeos/view_ids.h" | 11 #include "chrome/browser/chromeos/view_ids.h" |
12 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
13 #include "grit/theme_resources.h" | 13 #include "grit/theme_resources.h" |
14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
15 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
16 #include "ui/gfx/gtk_util.h" | 16 #include "ui/gfx/gtk_util.h" |
17 #include "views/background.h" | 17 #include "views/background.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Style parameters for Shutdown button. | 21 // Style parameters for Shutdown button. |
22 | 22 |
23 // Bottom/Right padding to locale the shutdown button. | 23 // Bottom/Right padding to locale the shutdown button. |
24 const int kBottomPadding = 12; | 24 const int kBottomPadding = 12; |
25 const int kRightPadding = 12; | 25 const int kRightPadding = 12; |
26 | 26 |
27 // Normal/Hover colors. | 27 // Normal/Hover colors. |
28 const SkColor kShutdownButtonColor = 0xFF242A35; | 28 const SkColor kShutdownButtonColor = 0xFF303845; |
29 const SkColor kShutdownHoverColor = 0xFF353E4E; | 29 const SkColor kShutdownHoverColor = 0xFF353E4E; |
30 | 30 |
31 // Padding inside button. | 31 // Padding inside button. |
32 const int kVerticalPadding = 13; | 32 const int kVerticalPadding = 13; |
33 const int kIconTextPadding = 10; | 33 const int kIconTextPadding = 10; |
34 const int kHorizontalPadding = 13; | 34 const int kHorizontalPadding = 13; |
35 | 35 |
36 // Rounded corner radious. | 36 // Rounded corner radious. |
37 const int kCornerRadius = 4; | 37 const int kCornerRadius = 4; |
38 | 38 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |