Commit 2e817b82 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Unified: Stop showing slider on multi display.

This CL stops showing slider bubble when main bubble is shown on any
display.

TEST=manual
BUG=852866

Change-Id: I18e80b9ba480e88dd08bb10fe1b92adbeace7582
Reviewed-on: https://chromium-review.googlesource.com/1141556
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576373}
parent d0b8c826
...@@ -4,9 +4,12 @@ ...@@ -4,9 +4,12 @@
#include "ash/system/unified/unified_slider_bubble_controller.h" #include "ash/system/unified/unified_slider_bubble_controller.h"
#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "ash/system/audio/unified_volume_slider_controller.h" #include "ash/system/audio/unified_volume_slider_controller.h"
#include "ash/system/brightness/unified_brightness_slider_controller.h" #include "ash/system/brightness/unified_brightness_slider_controller.h"
#include "ash/system/keyboard_brightness/unified_keyboard_brightness_slider_controller.h" #include "ash/system/keyboard_brightness/unified_keyboard_brightness_slider_controller.h"
#include "ash/system/status_area_widget.h"
#include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_constants.h"
#include "ash/system/unified/unified_system_tray.h" #include "ash/system/unified/unified_system_tray.h"
...@@ -14,6 +17,19 @@ using chromeos::CrasAudioHandler; ...@@ -14,6 +17,19 @@ using chromeos::CrasAudioHandler;
namespace ash { namespace ash {
namespace {
// Return true if a system tray bubble is shown in any display.
bool IsAnyMainBubbleShown() {
for (RootWindowController* root : Shell::GetAllRootWindowControllers()) {
if (root->GetStatusAreaWidget()->unified_system_tray()->IsBubbleShown())
return true;
}
return false;
}
} // namespace
UnifiedSliderBubbleController::UnifiedSliderBubbleController( UnifiedSliderBubbleController::UnifiedSliderBubbleController(
UnifiedSystemTray* tray) UnifiedSystemTray* tray)
: tray_(tray) { : tray_(tray) {
...@@ -83,7 +99,7 @@ void UnifiedSliderBubbleController::OnKeyboardBrightnessChanged(bool by_user) { ...@@ -83,7 +99,7 @@ void UnifiedSliderBubbleController::OnKeyboardBrightnessChanged(bool by_user) {
} }
void UnifiedSliderBubbleController::ShowBubble(SliderType slider_type) { void UnifiedSliderBubbleController::ShowBubble(SliderType slider_type) {
if (tray_->IsBubbleShown()) { if (IsAnyMainBubbleShown()) {
tray_->EnsureBubbleExpanded(); tray_->EnsureBubbleExpanded();
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment