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

Side by Side Diff: ui/views/widget/root_view.h

Issue 1876553002: mash: Close system tray bubble on click outside its bounds, part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_VIEWS_WIDGET_ROOT_VIEW_H_ 5 #ifndef UI_VIEWS_WIDGET_ROOT_VIEW_H_
6 #define UI_VIEWS_WIDGET_ROOT_VIEW_H_ 6 #define UI_VIEWS_WIDGET_ROOT_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 // |view| is the view receiving |event|. This function sends the event to all 153 // |view| is the view receiving |event|. This function sends the event to all
154 // the Views up the hierarchy that has |notify_enter_exit_on_child_| flag 154 // the Views up the hierarchy that has |notify_enter_exit_on_child_| flag
155 // turned on, but does not contain |sibling|. 155 // turned on, but does not contain |sibling|.
156 ui::EventDispatchDetails NotifyEnterExitOfDescendant( 156 ui::EventDispatchDetails NotifyEnterExitOfDescendant(
157 const ui::MouseEvent& event, 157 const ui::MouseEvent& event,
158 ui::EventType type, 158 ui::EventType type,
159 View* view, 159 View* view,
160 View* sibling) WARN_UNUSED_RESULT; 160 View* sibling) WARN_UNUSED_RESULT;
161 161
162 // Specialized version of SetMouseHandler(). If |clear_on_release| is true the
163 // mouse handler will be cleared on mouse release, which is the common case
164 // and used for drags. If |clear_on_release| is false then the mouse handler
165 // must be explicitly by calling SetMouseHandler() with null.
msw 2016/04/11 16:52:20 nit: 'explicitly released'
166 void SetMouseHandler(View* view, bool clear_on_release);
167
162 // Overridden from ui::EventDispatcherDelegate: 168 // Overridden from ui::EventDispatcherDelegate:
163 bool CanDispatchToTarget(ui::EventTarget* target) override; 169 bool CanDispatchToTarget(ui::EventTarget* target) override;
164 ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target, 170 ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target,
165 ui::Event* event) override; 171 ui::Event* event) override;
166 ui::EventDispatchDetails PostDispatchEvent(ui::EventTarget* target, 172 ui::EventDispatchDetails PostDispatchEvent(ui::EventTarget* target,
167 const ui::Event& event) override; 173 const ui::Event& event) override;
168 174
169 ////////////////////////////////////////////////////////////////////////////// 175 //////////////////////////////////////////////////////////////////////////////
170 // Tree operations ----------------------------------------------------------- 176 // Tree operations -----------------------------------------------------------
171 177
172 // The host Widget 178 // The host Widget
173 Widget* widget_; 179 Widget* widget_;
174 180
175 // Input --------------------------------------------------------------------- 181 // Input ---------------------------------------------------------------------
176 182
177 // TODO(tdanderson): Consider moving the input-related members into 183 // TODO(tdanderson): Consider moving the input-related members into
178 // ViewTargeter / RootViewTargeter. 184 // ViewTargeter / RootViewTargeter.
179 185
180 // The view currently handing down - drag - up 186 // The view currently handing down - drag - up
181 View* mouse_pressed_handler_; 187 View* mouse_pressed_handler_;
182 188
183 // The view currently handling enter / exit 189 // The view currently handling enter / exit
184 View* mouse_move_handler_; 190 View* mouse_move_handler_;
185 191
186 // The last view to handle a mouse click, so that we can determine if 192 // The last view to handle a mouse click, so that we can determine if
187 // a double-click lands on the same view as its single-click part. 193 // a double-click lands on the same view as its single-click part.
188 View* last_click_handler_; 194 View* last_click_handler_;
189 195
190 // true if mouse_pressed_handler_ has been explicitly set 196 // True if mouse_pressed_handler_ has been explicitly set.
191 bool explicit_mouse_handler_; 197 bool explicit_mouse_handler_;
192 198
199 // True if mouse_pressed_handler_ should be automatically cleared on mouse
200 // release, as is common during drags.
201 bool clear_mouse_handler_on_release_;
202
193 // Last position/flag of a mouse press/drag. Used if capture stops and we need 203 // Last position/flag of a mouse press/drag. Used if capture stops and we need
194 // to synthesize a release. 204 // to synthesize a release.
195 int last_mouse_event_flags_; 205 int last_mouse_event_flags_;
196 int last_mouse_event_x_; 206 int last_mouse_event_x_;
197 int last_mouse_event_y_; 207 int last_mouse_event_y_;
198 208
199 // The View currently handling gesture events. 209 // The View currently handling gesture events.
200 View* gesture_handler_; 210 View* gesture_handler_;
201 211
202 // Used to indicate if the |gesture_handler_| member was set prior to the 212 // Used to indicate if the |gesture_handler_| member was set prior to the
(...skipping 30 matching lines...) Expand all
233 // Tracks drag state for a view. 243 // Tracks drag state for a view.
234 View::DragInfo drag_info_; 244 View::DragInfo drag_info_;
235 245
236 DISALLOW_IMPLICIT_CONSTRUCTORS(RootView); 246 DISALLOW_IMPLICIT_CONSTRUCTORS(RootView);
237 }; 247 };
238 248
239 } // namespace internal 249 } // namespace internal
240 } // namespace views 250 } // namespace views
241 251
242 #endif // UI_VIEWS_WIDGET_ROOT_VIEW_H_ 252 #endif // UI_VIEWS_WIDGET_ROOT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698