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

Side by Side Diff: ui/aura/window_targeter.h

Issue 2172363002: Created min size for print preview dialog and modified to allow the Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mac compile error. Created 4 years, 4 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef UI_AURA_WINDOW_TARGETER_H_ 5 #ifndef UI_AURA_WINDOW_TARGETER_H_
6 #define UI_AURA_WINDOW_TARGETER_H_ 6 #define UI_AURA_WINDOW_TARGETER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/aura/aura_export.h" 9 #include "ui/aura/aura_export.h"
10 #include "ui/events/event_targeter.h" 10 #include "ui/events/event_targeter.h"
11 11
12 namespace ui { 12 namespace ui {
13 class KeyEvent; 13 class KeyEvent;
14 class LocatedEvent; 14 class LocatedEvent;
15 } // namespace ui 15 } // namespace ui
16 16
17 namespace gfx {
18 class Point;
19 } // namespace gfx
20
17 namespace aura { 21 namespace aura {
18 22
23 // Key for native window proprety that indicates if the window should have
24 // bounds independent of its modal parent. Only supported on ChromeOS.
25 AURA_EXPORT extern const char kHasIndependentBoundsKey[];
26
19 class Window; 27 class Window;
20 28
21 class AURA_EXPORT WindowTargeter : public ui::EventTargeter { 29 class AURA_EXPORT WindowTargeter : public ui::EventTargeter {
22 public: 30 public:
23 WindowTargeter(); 31 WindowTargeter();
24 ~WindowTargeter() override; 32 ~WindowTargeter() override;
25 33
26 // Returns true if |window| or one of its descendants can be a target of 34 // Returns true if |window| or one of its descendants can be a target of
27 // |event|. This requires that |window| and its descendants are not 35 // |event|. This requires that |window| and its descendants are not
28 // prohibited from accepting the event, and that the event is within an 36 // prohibited from accepting the event, and that the event is within an
(...skipping 24 matching lines...) Expand all
53 // parent's coordinate system. 61 // parent's coordinate system.
54 virtual bool EventLocationInsideBounds(Window* target, 62 virtual bool EventLocationInsideBounds(Window* target,
55 const ui::LocatedEvent& event) const; 63 const ui::LocatedEvent& event) const;
56 64
57 // ui::EventTargeter: 65 // ui::EventTargeter:
58 ui::EventTarget* FindTargetForEvent(ui::EventTarget* root, 66 ui::EventTarget* FindTargetForEvent(ui::EventTarget* root,
59 ui::Event* event) override; 67 ui::Event* event) override;
60 ui::EventTarget* FindNextBestTarget(ui::EventTarget* previous_target, 68 ui::EventTarget* FindNextBestTarget(ui::EventTarget* previous_target,
61 ui::Event* event) override; 69 ui::Event* event) override;
62 70
71 // Returns true if |child|'s bounds can extend outside of |parent|'s bounds.
72 static bool ChildHasBoundsOutsideParent(Window* parent, Window *child);
Lei Zhang 2016/08/19 03:28:47 '*' goes with the type, not the name.
rbpotter 2016/08/19 16:59:42 Done.
73
74 // Returns whether the location of |event_point| is in an actionable region of
75 // |window| or any of its children. Does not assume that children are
76 // restricted to the bounds of their modal parent windows if the
77 // kHasIndependentBounds property is set. If |in_parent_coordinates| is true
78 // then |event_point| is in |window|'s parent's coordinate system, if false
79 // |event_point| is in |window|'s coordinate system.
80 bool HasIndependentChildWithEvent(Window* window,
81 const gfx::Point& event_point,
82 bool in_parent_coordinates);
83
63 private: 84 private:
64 Window* FindTargetForKeyEvent(Window* root_window, const ui::KeyEvent& event); 85 Window* FindTargetForKeyEvent(Window* root_window, const ui::KeyEvent& event);
65 Window* FindTargetForNonKeyEvent(Window* root_window, ui::Event* event); 86 Window* FindTargetForNonKeyEvent(Window* root_window, ui::Event* event);
66 Window* FindTargetInRootWindow(Window* root_window, 87 Window* FindTargetInRootWindow(Window* root_window,
67 const ui::LocatedEvent& event); 88 const ui::LocatedEvent& event);
68 Window* FindTargetForLocatedEventRecursively(Window* root_window, 89 Window* FindTargetForLocatedEventRecursively(Window* root_window,
69 ui::LocatedEvent* event); 90 ui::LocatedEvent* event);
70 91
71 DISALLOW_COPY_AND_ASSIGN(WindowTargeter); 92 DISALLOW_COPY_AND_ASSIGN(WindowTargeter);
72 }; 93 };
73 94
74 } // namespace aura 95 } // namespace aura
75 96
76 #endif // UI_AURA_WINDOW_TARGETER_H_ 97 #endif // UI_AURA_WINDOW_TARGETER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698