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