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

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

Issue 191973004: chromeos: Add external brightness control to chrome://flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/brightness/tray_brightness.cc
diff --git a/ash/system/chromeos/brightness/tray_brightness.cc b/ash/system/chromeos/brightness/tray_brightness.cc
index dcce3c110b29654efafc019c32d914921b1af8d0..19ff250c3149344698d6f2d7cdc3262fc3156131 100644
--- a/ash/system/chromeos/brightness/tray_brightness.cc
+++ b/ash/system/chromeos/brightness/tray_brightness.cc
@@ -6,6 +6,7 @@
#include "ash/accelerators/accelerator_controller.h"
#include "ash/ash_constants.h"
+#include "ash/display/display_manager.h"
#include "ash/metrics/user_metrics_recorder.h"
#include "ash/shell.h"
#include "ash/system/brightness_control_delegate.h"
@@ -219,9 +220,16 @@ void TrayBrightness::HandleBrightnessChanged(double percent,
if (brightness_view_)
brightness_view_->SetBrightnessPercent(percent);
+
if (!user_initiated)
return;
+ // Never show the bubble on systems that lack internal displays: if an
+ // external display's brightness is changed, it may already display the new
+ // level via an on-screen display.
+ if (!Shell::GetInstance()->display_manager()->HasInternalDisplay())
+ return;
+
if (brightness_view_)
SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds);
else
« no previous file with comments | « no previous file | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698