| 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 // the appropriate events. This is used to send mouse events to child views so | 383 // the appropriate events. This is used to send mouse events to child views so |
| 384 // that they react to click-drag-release as if the user clicked on the view | 384 // that they react to click-drag-release as if the user clicked on the view |
| 385 // itself. | 385 // itself. |
| 386 void UpdateActiveMouseView(SubmenuView* event_source, | 386 void UpdateActiveMouseView(SubmenuView* event_source, |
| 387 const MouseEvent& event, | 387 const MouseEvent& event, |
| 388 View* target_menu); | 388 View* target_menu); |
| 389 | 389 |
| 390 // Sends a mouse release event to the current |active_mouse_view_| and sets | 390 // Sends a mouse release event to the current |active_mouse_view_| and sets |
| 391 // it to null. | 391 // it to null. |
| 392 void SendMouseReleaseToActiveView(SubmenuView* event_source, | 392 void SendMouseReleaseToActiveView(SubmenuView* event_source, |
| 393 const MouseEvent& event, | 393 const MouseEvent& event); |
| 394 bool cancel); | |
| 395 | 394 |
| 396 // Variant of above that sends a cancel mouse release. | 395 // Sends a mouse capture lost event to the current |active_mouse_view_| and |
| 397 void SendMouseReleaseToActiveView(); | 396 // sets it to null. |
| 397 void SendMouseCaptureLostToActiveView(); |
| 398 | 398 |
| 399 // The active instance. | 399 // The active instance. |
| 400 static MenuController* active_instance_; | 400 static MenuController* active_instance_; |
| 401 | 401 |
| 402 // If true, Run blocks. If false, Run doesn't block and this is used for | 402 // If true, Run blocks. If false, Run doesn't block and this is used for |
| 403 // drag and drop. Note that the semantics for drag and drop are slightly | 403 // drag and drop. Note that the semantics for drag and drop are slightly |
| 404 // different: cancel timer is kicked off any time the drag moves outside the | 404 // different: cancel timer is kicked off any time the drag moves outside the |
| 405 // menu, mouse events do nothing... | 405 // menu, mouse events do nothing... |
| 406 bool blocking_run_; | 406 bool blocking_run_; |
| 407 | 407 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 // If non-null mouse drag events are forwarded to this view. See | 480 // If non-null mouse drag events are forwarded to this view. See |
| 481 // UpdateActiveMouseView for details. | 481 // UpdateActiveMouseView for details. |
| 482 View* active_mouse_view_; | 482 View* active_mouse_view_; |
| 483 | 483 |
| 484 DISALLOW_COPY_AND_ASSIGN(MenuController); | 484 DISALLOW_COPY_AND_ASSIGN(MenuController); |
| 485 }; | 485 }; |
| 486 | 486 |
| 487 } // namespace views | 487 } // namespace views |
| 488 | 488 |
| 489 #endif // VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 489 #endif // VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
| OLD | NEW |