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 #include "views/controls/menu/menu_host_win.h" | 5 #include "views/controls/menu/menu_host_win.h" |
6 | 6 |
7 #include "base/win/windows_version.h" | 7 #include "base/win/windows_version.h" |
8 #include "views/controls/menu/menu_controller.h" | 8 #include "views/controls/menu/menu_controller.h" |
9 #include "views/controls/menu/menu_host_root_view.h" | 9 #include "views/controls/menu/menu_host_root_view.h" |
10 #include "views/controls/menu/menu_item_view.h" | 10 #include "views/controls/menu/menu_item_view.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 void MenuHostWin::OnCancelMode() { | 101 void MenuHostWin::OnCancelMode() { |
102 submenu_->GetMenuItem()->GetMenuController()->Cancel( | 102 submenu_->GetMenuItem()->GetMenuController()->Cancel( |
103 MenuController::EXIT_ALL); | 103 MenuController::EXIT_ALL); |
104 } | 104 } |
105 | 105 |
106 RootView* MenuHostWin::CreateRootView() { | 106 RootView* MenuHostWin::CreateRootView() { |
107 return new MenuHostRootView(this, submenu_); | 107 return new MenuHostRootView(this, submenu_); |
108 } | 108 } |
109 | 109 |
110 bool MenuHostWin::ReleaseCaptureOnMouseReleased() { | 110 bool MenuHostWin::ShouldReleaseCaptureOnMouseReleased() const { |
111 return false; | 111 return false; |
112 } | 112 } |
113 | 113 |
114 //////////////////////////////////////////////////////////////////////////////// | 114 //////////////////////////////////////////////////////////////////////////////// |
115 // MenuHostWin, private: | 115 // MenuHostWin, private: |
116 | 116 |
117 void MenuHostWin::DoCapture() { | 117 void MenuHostWin::DoCapture() { |
118 owns_capture_ = true; | 118 owns_capture_ = true; |
119 SetNativeCapture(); | 119 SetMouseCapture(); |
120 } | 120 } |
121 | 121 |
122 //////////////////////////////////////////////////////////////////////////////// | 122 //////////////////////////////////////////////////////////////////////////////// |
123 // NativeMenuHost, public: | 123 // NativeMenuHost, public: |
124 | 124 |
125 // static | 125 // static |
126 NativeMenuHost* NativeMenuHost::CreateNativeMenuHost(SubmenuView* submenu) { | 126 NativeMenuHost* NativeMenuHost::CreateNativeMenuHost(SubmenuView* submenu) { |
127 return new MenuHostWin(submenu); | 127 return new MenuHostWin(submenu); |
128 } | 128 } |
129 | 129 |
130 } // namespace views | 130 } // namespace views |
OLD | NEW |