| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.ToSkBitmap()); |
| 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_color(kFocusBorderColor); |
| 59 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); | 60 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); |
| 60 slider_->SetAccessibleName( | 61 slider_->SetAccessibleName( |
| 61 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( | 62 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( |
| 62 IDS_ASH_STATUS_TRAY_BRIGHTNESS)); | 63 IDS_ASH_STATUS_TRAY_BRIGHTNESS)); |
| 63 AddChildView(slider_); | 64 AddChildView(slider_); |
| 64 } | 65 } |
| 65 | 66 |
| 66 virtual ~BrightnessView() {} | 67 virtual ~BrightnessView() {} |
| 67 | 68 |
| 68 // |percent| is in the range [0.0, 100.0]. | 69 // |percent| is in the range [0.0, 100.0]. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 return; | 194 return; |
| 194 | 195 |
| 195 if (brightness_view_.get()) | 196 if (brightness_view_.get()) |
| 196 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); | 197 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); |
| 197 else | 198 else |
| 198 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); | 199 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); |
| 199 } | 200 } |
| 200 | 201 |
| 201 } // namespace internal | 202 } // namespace internal |
| 202 } // namespace ash | 203 } // namespace ash |
| OLD | NEW |