OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/system/brightness/tray_brightness.h" | 5 #include "ash/system/brightness/tray_brightness.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/system/brightness/brightness_control_delegate.h" | 9 #include "ash/system/brightness/brightness_control_delegate.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 public: | 45 public: |
46 explicit BrightnessView(double initial_percent) | 46 explicit BrightnessView(double initial_percent) |
47 : dragging_(false), | 47 : dragging_(false), |
48 last_percent_(initial_percent) { | 48 last_percent_(initial_percent) { |
49 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, | 49 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, |
50 kTrayPopupPaddingHorizontal, 0, kTrayPopupPaddingBetweenItems)); | 50 kTrayPopupPaddingHorizontal, 0, kTrayPopupPaddingBetweenItems)); |
51 | 51 |
52 views::ImageView* icon = new FixedSizedImageView(0, kTrayPopupItemHeight); | 52 views::ImageView* icon = new FixedSizedImageView(0, kTrayPopupItemHeight); |
53 gfx::Image image = ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 53 gfx::Image image = ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
54 IDR_AURA_UBER_TRAY_BRIGHTNESS); | 54 IDR_AURA_UBER_TRAY_BRIGHTNESS); |
55 icon->SetImage(image.ToSkBitmap()); | 55 icon->SetImage(image.ToImageSkia()); |
56 AddChildView(icon); | 56 AddChildView(icon); |
57 | 57 |
58 slider_ = new views::Slider(this, views::Slider::HORIZONTAL); | 58 slider_ = new views::Slider(this, views::Slider::HORIZONTAL); |
59 slider_->set_focus_border_color(kFocusBorderColor); | 59 slider_->set_focus_border_color(kFocusBorderColor); |
60 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); | 60 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); |
61 slider_->SetAccessibleName( | 61 slider_->SetAccessibleName( |
62 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( | 62 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( |
63 IDS_ASH_STATUS_TRAY_BRIGHTNESS)); | 63 IDS_ASH_STATUS_TRAY_BRIGHTNESS)); |
64 AddChildView(slider_); | 64 AddChildView(slider_); |
65 } | 65 } |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 return; | 200 return; |
201 | 201 |
202 if (brightness_view_) | 202 if (brightness_view_) |
203 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); | 203 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); |
204 else | 204 else |
205 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); | 205 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); |
206 } | 206 } |
207 | 207 |
208 } // namespace internal | 208 } // namespace internal |
209 } // namespace ash | 209 } // namespace ash |
OLD | NEW |