Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2996)

Unified Diff: ash/common/system/chromeos/brightness/tray_brightness.cc

Issue 2329333002: [Chrome OS MD] Enable the brightness row to be visible at all times (Closed)
Patch Set: address comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/common/system/chromeos/brightness/tray_brightness_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/brightness/tray_brightness.cc
diff --git a/ash/common/system/chromeos/brightness/tray_brightness.cc b/ash/common/system/chromeos/brightness/tray_brightness.cc
index cada6c43bf6566ac3efc0a471dbb39658aeb50c5..3fa700e729e8d85b01c73bcd57de3c38b80b8675 100644
--- a/ash/common/system/chromeos/brightness/tray_brightness.cc
+++ b/ash/common/system/chromeos/brightness/tray_brightness.cc
@@ -47,6 +47,9 @@ const double kMinBrightnessPercent = 5.0;
} // namespace
+// TODO(yiyix|tdanderson): Once Chrome OS material design is enabled by default,
+// BrightnessView does not need to be a ShellObserver to observe touch view mode
+// changes. See crbug.com/614453.
class BrightnessView : public ShellObserver,
public views::View,
public views::SliderListener {
@@ -123,11 +126,15 @@ BrightnessView::BrightnessView(bool default_view, double initial_percent)
rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_BRIGHTNESS));
AddChildView(slider_);
- if (is_default_view_) {
- WmShell::Get()->AddShellObserver(this);
- SetVisible(WmShell::Get()
- ->maximize_mode_controller()
- ->IsMaximizeModeWindowManagerEnabled());
+ if (MaterialDesignController::IsSystemTrayMenuMaterial()) {
+ SetVisible(true);
+ } else {
+ if (is_default_view_) {
+ WmShell::Get()->AddShellObserver(this);
+ SetVisible(WmShell::Get()
+ ->maximize_mode_controller()
+ ->IsMaximizeModeWindowManagerEnabled());
+ }
}
}
@@ -143,11 +150,13 @@ void BrightnessView::SetBrightnessPercent(double percent) {
}
void BrightnessView::OnMaximizeModeStarted() {
- SetVisible(true);
+ if (!MaterialDesignController::IsSystemTrayMenuMaterial())
+ SetVisible(true);
}
void BrightnessView::OnMaximizeModeEnded() {
- SetVisible(false);
+ if (!MaterialDesignController::IsSystemTrayMenuMaterial())
+ SetVisible(false);
}
void BrightnessView::OnBoundsChanged(const gfx::Rect& old_bounds) {
« no previous file with comments | « no previous file | ash/common/system/chromeos/brightness/tray_brightness_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698