OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 5 #ifndef VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
6 #define VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 6 #define VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 // the appropriate events. This is used to send mouse events to child views so | 387 // the appropriate events. This is used to send mouse events to child views so |
388 // that they react to click-drag-release as if the user clicked on the view | 388 // that they react to click-drag-release as if the user clicked on the view |
389 // itself. | 389 // itself. |
390 void UpdateActiveMouseView(SubmenuView* event_source, | 390 void UpdateActiveMouseView(SubmenuView* event_source, |
391 const MouseEvent& event, | 391 const MouseEvent& event, |
392 View* target_menu); | 392 View* target_menu); |
393 | 393 |
394 // Sends a mouse release event to the current |active_mouse_view_| and sets | 394 // Sends a mouse release event to the current |active_mouse_view_| and sets |
395 // it to null. | 395 // it to null. |
396 void SendMouseReleaseToActiveView(SubmenuView* event_source, | 396 void SendMouseReleaseToActiveView(SubmenuView* event_source, |
397 const MouseEvent& event, | 397 const MouseEvent& event); |
398 bool cancel); | |
399 | 398 |
400 // Variant of above that sends a cancel mouse release. | 399 // Sends a mouse capture lost event to the current |active_mouse_view_| and |
401 void SendMouseReleaseToActiveView(); | 400 // sets it to null. |
| 401 void SendMouseCaptureLostToActiveView(); |
402 | 402 |
403 // The active instance. | 403 // The active instance. |
404 static MenuController* active_instance_; | 404 static MenuController* active_instance_; |
405 | 405 |
406 // If true, Run blocks. If false, Run doesn't block and this is used for | 406 // If true, Run blocks. If false, Run doesn't block and this is used for |
407 // drag and drop. Note that the semantics for drag and drop are slightly | 407 // drag and drop. Note that the semantics for drag and drop are slightly |
408 // different: cancel timer is kicked off any time the drag moves outside the | 408 // different: cancel timer is kicked off any time the drag moves outside the |
409 // menu, mouse events do nothing... | 409 // menu, mouse events do nothing... |
410 bool blocking_run_; | 410 bool blocking_run_; |
411 | 411 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 // If non-null mouse drag events are forwarded to this view. See | 484 // If non-null mouse drag events are forwarded to this view. See |
485 // UpdateActiveMouseView for details. | 485 // UpdateActiveMouseView for details. |
486 View* active_mouse_view_; | 486 View* active_mouse_view_; |
487 | 487 |
488 DISALLOW_COPY_AND_ASSIGN(MenuController); | 488 DISALLOW_COPY_AND_ASSIGN(MenuController); |
489 }; | 489 }; |
490 | 490 |
491 } // namespace views | 491 } // namespace views |
492 | 492 |
493 #endif // VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 493 #endif // VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |