Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_CONTROLS_MENU_MENU_HOST_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_HOST_H_ |
| 6 #define UI_VIEWS_CONTROLS_MENU_MENU_HOST_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_HOST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 | 60 |
| 61 // Destroys and deletes the menu host. | 61 // Destroys and deletes the menu host. |
| 62 void DestroyMenuHost(); | 62 void DestroyMenuHost(); |
| 63 | 63 |
| 64 // Sets the bounds of the menu host. | 64 // Sets the bounds of the menu host. |
| 65 void SetMenuHostBounds(const gfx::Rect& bounds); | 65 void SetMenuHostBounds(const gfx::Rect& bounds); |
| 66 | 66 |
| 67 // Releases a mouse grab installed by |ShowMenuHost|. | 67 // Releases a mouse grab installed by |ShowMenuHost|. |
| 68 void ReleaseMenuHostCapture(); | 68 void ReleaseMenuHostCapture(); |
| 69 | 69 |
| 70 void TransferEvents(Widget* source, Widget* target); | |
|
xiyuan
2017/05/15 19:20:52
This does not depend on any MenuHost state and not
minch1
2017/05/16 22:13:39
Done.
| |
| 71 | |
| 70 private: | 72 private: |
| 71 friend class test::MenuControllerTest; | 73 friend class test::MenuControllerTest; |
| 72 | 74 |
| 73 // Overridden from Widget: | 75 // Overridden from Widget: |
| 74 internal::RootView* CreateRootView() override; | 76 internal::RootView* CreateRootView() override; |
| 75 void OnMouseCaptureLost() override; | 77 void OnMouseCaptureLost() override; |
| 76 void OnNativeWidgetDestroyed() override; | 78 void OnNativeWidgetDestroyed() override; |
| 77 void OnOwnerClosing() override; | 79 void OnOwnerClosing() override; |
| 78 void OnDragWillStart() override; | 80 void OnDragWillStart() override; |
| 79 void OnDragComplete() override; | 81 void OnDragComplete() override; |
| 80 | 82 |
| 81 // The view we contain. | 83 // The view we contain. |
| 82 SubmenuView* submenu_; | 84 SubmenuView* submenu_; |
| 83 | 85 |
| 86 Widget* owner_ = NULL; | |
|
xiyuan
2017/05/15 19:20:52
Document the member and insert an empty line after
xiyuan
2017/05/15 19:20:52
NULL -> nullptr
minch1
2017/05/16 22:13:39
Done.
| |
| 84 // If true, DestroyMenuHost has been invoked. | 87 // If true, DestroyMenuHost has been invoked. |
| 85 bool destroying_; | 88 bool destroying_; |
| 86 | 89 |
| 87 // If true and capture is lost we don't notify the delegate. | 90 // If true and capture is lost we don't notify the delegate. |
| 88 bool ignore_capture_lost_; | 91 bool ignore_capture_lost_; |
| 89 | 92 |
| 90 #if !defined(OS_MACOSX) | 93 #if !defined(OS_MACOSX) |
| 91 // Handles raw touch events at the moment. | 94 // Handles raw touch events at the moment. |
| 92 std::unique_ptr<internal::PreMenuEventDispatchHandler> pre_dispatch_handler_; | 95 std::unique_ptr<internal::PreMenuEventDispatchHandler> pre_dispatch_handler_; |
| 93 #endif | 96 #endif |
| 94 | 97 |
| 95 DISALLOW_COPY_AND_ASSIGN(MenuHost); | 98 DISALLOW_COPY_AND_ASSIGN(MenuHost); |
| 96 }; | 99 }; |
| 97 | 100 |
| 98 } // namespace views | 101 } // namespace views |
| 99 | 102 |
| 100 #endif // UI_VIEWS_CONTROLS_MENU_MENU_HOST_H_ | 103 #endif // UI_VIEWS_CONTROLS_MENU_MENU_HOST_H_ |
| OLD | NEW |