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

Side by Side Diff: ash/common/system/chromeos/palette/palette_utils.cc

Issue 2303963002: cros/ash: If the partial magnifier is active, do not consume input events if over palette views. (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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/palette/palette_utils.h" 5 #include "ash/common/system/chromeos/palette/palette_utils.h"
6 6
7 #include "ash/common/ash_switches.h" 7 #include "ash/common/ash_switches.h"
8 #include "ash/common/shelf/wm_shelf.h"
9 #include "ash/common/system/chromeos/palette/palette_tray.h"
10 #include "ash/common/system/status_area_widget.h"
11 #include "ash/common/wm_shell.h"
12 #include "ash/common/wm_window.h"
8 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "ui/gfx/geometry/point.h"
9 15
10 namespace ash { 16 namespace ash {
11 17
12 bool IsPaletteFeatureEnabled() { 18 bool IsPaletteFeatureEnabled() {
13 return base::CommandLine::ForCurrentProcess()->HasSwitch( 19 return base::CommandLine::ForCurrentProcess()->HasSwitch(
14 switches::kAshEnablePalette); 20 switches::kAshEnablePalette);
15 } 21 }
16 22
17 bool ArePaletteExperimentalFeaturesEnabled() { 23 bool ArePaletteExperimentalFeaturesEnabled() {
18 return base::CommandLine::ForCurrentProcess()->HasSwitch( 24 return base::CommandLine::ForCurrentProcess()->HasSwitch(
19 switches::kAshEnablePaletteExperimentalFeatures); 25 switches::kAshEnablePaletteExperimentalFeatures);
20 } 26 }
21 27
22 bool IsPaletteEnabledOnEveryDisplay() { 28 bool IsPaletteEnabledOnEveryDisplay() {
23 return base::CommandLine::ForCurrentProcess()->HasSwitch( 29 return base::CommandLine::ForCurrentProcess()->HasSwitch(
24 switches::kAshEnablePaletteOnAllDisplays); 30 switches::kAshEnablePaletteOnAllDisplays);
25 } 31 }
26 32
33 bool PaletteContainsPointInScreen(const gfx::Point& point) {
34 for (WmWindow* window : WmShell::Get()->GetAllRootWindows()) {
35 PaletteTray* palette_tray =
36 WmShelf::ForWindow(window)->GetStatusAreaWidget()->palette_tray();
37 if (palette_tray && palette_tray->ContainsPointInScreen(point))
38 return true;
39 }
40
41 return false;
42 }
43
27 } // namespace ash 44 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/palette/palette_utils.h ('k') | ash/magnifier/partial_magnification_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698