| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/brightness/tray_brightness.h" | 5 #include "ash/system/chromeos/brightness/tray_brightness.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/accelerators/accelerator_controller.h" | 9 #include "ash/accelerators/accelerator_controller.h" |
| 10 #include "ash/common/ash_constants.h" | 10 #include "ash/common/ash_constants.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 slider_ = new views::Slider(this, views::Slider::HORIZONTAL); | 107 slider_ = new views::Slider(this, views::Slider::HORIZONTAL); |
| 108 slider_->set_focus_border_color(kFocusBorderColor); | 108 slider_->set_focus_border_color(kFocusBorderColor); |
| 109 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); | 109 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); |
| 110 slider_->SetAccessibleName( | 110 slider_->SetAccessibleName( |
| 111 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( | 111 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( |
| 112 IDS_ASH_STATUS_TRAY_BRIGHTNESS)); | 112 IDS_ASH_STATUS_TRAY_BRIGHTNESS)); |
| 113 AddChildView(slider_); | 113 AddChildView(slider_); |
| 114 | 114 |
| 115 if (is_default_view_) { | 115 if (is_default_view_) { |
| 116 WmShell::Get()->AddShellObserver(this); | 116 WmShell::Get()->AddShellObserver(this); |
| 117 SetVisible(Shell::GetInstance() | 117 SetVisible(WmShell::Get() |
| 118 ->maximize_mode_controller() | 118 ->maximize_mode_controller() |
| 119 ->IsMaximizeModeWindowManagerEnabled()); | 119 ->IsMaximizeModeWindowManagerEnabled()); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 BrightnessView::~BrightnessView() { | 123 BrightnessView::~BrightnessView() { |
| 124 if (is_default_view_) | 124 if (is_default_view_) |
| 125 WmShell::Get()->RemoveShellObserver(this); | 125 WmShell::Get()->RemoveShellObserver(this); |
| 126 } | 126 } |
| 127 | 127 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 if (!display::Display::HasInternalDisplay()) | 271 if (!display::Display::HasInternalDisplay()) |
| 272 return; | 272 return; |
| 273 | 273 |
| 274 if (brightness_view_) | 274 if (brightness_view_) |
| 275 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); | 275 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); |
| 276 else | 276 else |
| 277 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); | 277 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); |
| 278 } | 278 } |
| 279 | 279 |
| 280 } // namespace ash | 280 } // namespace ash |
| OLD | NEW |