OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/status/power_menu_button.h" | 5 #include "chrome/browser/chromeos/status/power_menu_button.h" |
6 | 6 |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
11 #include "gfx/canvas.h" | |
12 #include "grit/generated_resources.h" | 11 #include "grit/generated_resources.h" |
13 #include "grit/theme_resources.h" | 12 #include "grit/theme_resources.h" |
14 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
15 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
| 15 #include "ui/gfx/canvas.h" |
16 | 16 |
17 namespace chromeos { | 17 namespace chromeos { |
18 | 18 |
19 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
20 // PowerMenuButton | 20 // PowerMenuButton |
21 | 21 |
22 // static | 22 // static |
23 const int PowerMenuButton::kNumPowerImages = 16; | 23 const int PowerMenuButton::kNumPowerImages = 16; |
24 | 24 |
25 PowerMenuButton::PowerMenuButton() | 25 PowerMenuButton::PowerMenuButton() |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 icon_id_ = line_power_on_ ? | 183 icon_id_ = line_power_on_ ? |
184 kChargingImages[index] : kDischargingImages[index]; | 184 kChargingImages[index] : kDischargingImages[index]; |
185 } | 185 } |
186 | 186 |
187 SetIcon(*ResourceBundle::GetSharedInstance().GetBitmapNamed(icon_id_)); | 187 SetIcon(*ResourceBundle::GetSharedInstance().GetBitmapNamed(icon_id_)); |
188 SetTooltipText(UTF16ToWide(GetLabelAt(0))); | 188 SetTooltipText(UTF16ToWide(GetLabelAt(0))); |
189 SchedulePaint(); | 189 SchedulePaint(); |
190 } | 190 } |
191 | 191 |
192 } // namespace chromeos | 192 } // namespace chromeos |
OLD | NEW |