OLD | NEW |
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/system/palette/palette_utils.h" | 5 #include "ash/system/palette/palette_utils.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/palette_delegate.h" | 8 #include "ash/palette_delegate.h" |
9 #include "ash/shelf/wm_shelf.h" | 9 #include "ash/shelf/wm_shelf.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
11 #include "ash/shell_port.h" | |
12 #include "ash/system/palette/palette_tray.h" | 11 #include "ash/system/palette/palette_tray.h" |
13 #include "ash/system/status_area_widget.h" | 12 #include "ash/system/status_area_widget.h" |
14 #include "ash/wm_window.h" | 13 #include "ash/wm_window.h" |
15 #include "base/command_line.h" | 14 #include "base/command_line.h" |
16 #include "ui/display/display.h" | 15 #include "ui/display/display.h" |
17 #include "ui/events/devices/input_device_manager.h" | 16 #include "ui/events/devices/input_device_manager.h" |
18 #include "ui/events/devices/touchscreen_device.h" | 17 #include "ui/events/devices/touchscreen_device.h" |
19 #include "ui/gfx/geometry/point.h" | 18 #include "ui/gfx/geometry/point.h" |
20 | 19 |
21 namespace ash { | 20 namespace ash { |
(...skipping 26 matching lines...) Expand all Loading... |
48 | 47 |
49 bool ShouldShowPalette() { | 48 bool ShouldShowPalette() { |
50 return HasStylusInput() && | 49 return HasStylusInput() && |
51 (display::Display::HasInternalDisplay() || | 50 (display::Display::HasInternalDisplay() || |
52 IsPaletteEnabledOnEveryDisplay()) && | 51 IsPaletteEnabledOnEveryDisplay()) && |
53 Shell::Get()->palette_delegate() && | 52 Shell::Get()->palette_delegate() && |
54 Shell::Get()->palette_delegate()->ShouldShowPalette(); | 53 Shell::Get()->palette_delegate()->ShouldShowPalette(); |
55 } | 54 } |
56 | 55 |
57 bool PaletteContainsPointInScreen(const gfx::Point& point) { | 56 bool PaletteContainsPointInScreen(const gfx::Point& point) { |
58 for (WmWindow* window : ShellPort::Get()->GetAllRootWindows()) { | 57 for (aura::Window* window : Shell::GetAllRootWindows()) { |
59 PaletteTray* palette_tray = | 58 PaletteTray* palette_tray = |
60 WmShelf::ForWindow(window)->GetStatusAreaWidget()->palette_tray(); | 59 WmShelf::ForWindow(window)->GetStatusAreaWidget()->palette_tray(); |
61 if (palette_tray && palette_tray->ContainsPointInScreen(point)) | 60 if (palette_tray && palette_tray->ContainsPointInScreen(point)) |
62 return true; | 61 return true; |
63 } | 62 } |
64 | 63 |
65 return false; | 64 return false; |
66 } | 65 } |
67 | 66 |
68 } // namespace palette_utils | 67 } // namespace palette_utils |
69 } // namespace ash | 68 } // namespace ash |
OLD | NEW |