Chromium Code Reviews| 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/brightness/tray_brightness.h" | 5 #include "ash/system/brightness/tray_brightness.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/resources/grit/ash_resources.h" | 9 #include "ash/resources/grit/ash_resources.h" |
| 10 #include "ash/resources/vector_icons/vector_icons.h" | 10 #include "ash/resources/vector_icons/vector_icons.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); | 110 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); |
| 111 slider_->SetAccessibleName( | 111 slider_->SetAccessibleName( |
| 112 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BRIGHTNESS)); | 112 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BRIGHTNESS)); |
| 113 tri_view->AddView(TriView::Container::CENTER, slider_); | 113 tri_view->AddView(TriView::Container::CENTER, slider_); |
| 114 | 114 |
| 115 if (is_default_view_) { | 115 if (is_default_view_) { |
| 116 Shell::Get()->AddShellObserver(this); | 116 Shell::Get()->AddShellObserver(this); |
| 117 SetVisible(Shell::Get() | 117 SetVisible(Shell::Get() |
| 118 ->maximize_mode_controller() | 118 ->maximize_mode_controller() |
| 119 ->IsMaximizeModeWindowManagerEnabled()); | 119 ->IsMaximizeModeWindowManagerEnabled()); |
| 120 } else { | |
| 121 tri_view->SetContainerVisible(TriView::Container::END, false); | |
| 122 } | 120 } |
| 121 tri_view->SetContainerVisible(TriView::Container::END, false); | |
|
tdanderson
2017/04/18 23:50:29
Nice catch, thanks!
| |
| 123 } | 122 } |
| 124 | 123 |
| 125 BrightnessView::~BrightnessView() { | 124 BrightnessView::~BrightnessView() { |
| 126 if (is_default_view_) | 125 if (is_default_view_) |
| 127 Shell::Get()->RemoveShellObserver(this); | 126 Shell::Get()->RemoveShellObserver(this); |
| 128 } | 127 } |
| 129 | 128 |
| 130 void BrightnessView::SetBrightnessPercent(double percent) { | 129 void BrightnessView::SetBrightnessPercent(double percent) { |
| 131 last_percent_ = percent; | 130 last_percent_ = percent; |
| 132 if (!dragging_) | 131 if (!dragging_) |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 if (!display::Display::HasInternalDisplay()) | 268 if (!display::Display::HasInternalDisplay()) |
| 270 return; | 269 return; |
| 271 | 270 |
| 272 if (brightness_view_ && brightness_view_->visible()) | 271 if (brightness_view_ && brightness_view_->visible()) |
| 273 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); | 272 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); |
| 274 else | 273 else |
| 275 ShowDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); | 274 ShowDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); |
| 276 } | 275 } |
| 277 | 276 |
| 278 } // namespace ash | 277 } // namespace ash |
| OLD | NEW |