| 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/common/system/chromeos/brightness/tray_brightness.h" | 5 #include "ash/common/system/chromeos/brightness/tray_brightness.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/shell_observer.h" | 10 #include "ash/common/shell_observer.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 tri_view->AddView(TriView::Container::START, icon); | 113 tri_view->AddView(TriView::Container::START, icon); |
| 114 | 114 |
| 115 slider_ = TrayPopupUtils::CreateSlider(this); | 115 slider_ = TrayPopupUtils::CreateSlider(this); |
| 116 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); | 116 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); |
| 117 slider_->SetAccessibleName( | 117 slider_->SetAccessibleName( |
| 118 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BRIGHTNESS)); | 118 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BRIGHTNESS)); |
| 119 tri_view->AddView(TriView::Container::CENTER, slider_); | 119 tri_view->AddView(TriView::Container::CENTER, slider_); |
| 120 | 120 |
| 121 if (is_default_view_) { | 121 if (is_default_view_) { |
| 122 Shell::GetInstance()->AddShellObserver(this); | 122 Shell::GetInstance()->AddShellObserver(this); |
| 123 SetVisible(WmShell::Get() | 123 SetVisible(Shell::Get() |
| 124 ->maximize_mode_controller() | 124 ->maximize_mode_controller() |
| 125 ->IsMaximizeModeWindowManagerEnabled()); | 125 ->IsMaximizeModeWindowManagerEnabled()); |
| 126 } else { | 126 } else { |
| 127 tri_view->SetContainerVisible(TriView::Container::END, false); | 127 tri_view->SetContainerVisible(TriView::Container::END, false); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 | 130 |
| 131 BrightnessView::~BrightnessView() { | 131 BrightnessView::~BrightnessView() { |
| 132 if (is_default_view_) | 132 if (is_default_view_) |
| 133 Shell::GetInstance()->RemoveShellObserver(this); | 133 Shell::GetInstance()->RemoveShellObserver(this); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 if (!display::Display::HasInternalDisplay()) | 275 if (!display::Display::HasInternalDisplay()) |
| 276 return; | 276 return; |
| 277 | 277 |
| 278 if (brightness_view_ && brightness_view_->visible()) | 278 if (brightness_view_ && brightness_view_->visible()) |
| 279 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); | 279 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); |
| 280 else | 280 else |
| 281 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); | 281 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace ash | 284 } // namespace ash |
| OLD | NEW |