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

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

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Fix WmShelf::ForWindow. Created 3 years, 7 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/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
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
OLDNEW
« no previous file with comments | « ash/sticky_keys/sticky_keys_overlay_unittest.cc ('k') | ash/system/session/logout_confirmation_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698