summaryrefslogtreecommitdiffstats
path: root/views/controls/menu/menu_host_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls/menu/menu_host_win.cc')
-rw-r--r--views/controls/menu/menu_host_win.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/views/controls/menu/menu_host_win.cc b/views/controls/menu/menu_host_win.cc
index d6fd655..f2c2c2c 100644
--- a/views/controls/menu/menu_host_win.cc
+++ b/views/controls/menu/menu_host_win.cc
@@ -37,14 +37,8 @@ void MenuHost::Init(HWND parent,
WidgetWin::Init(parent, bounds);
SetContentsView(contents_view);
Show();
- owns_capture_ = do_capture;
- if (do_capture) {
- SetCapture();
- has_capture_ = true;
-#ifdef DEBUG_MENU
- DLOG(INFO) << "Doing capture";
-#endif
- }
+ if (do_capture)
+ DoCapture();
}
void MenuHost::Show() {
@@ -82,6 +76,15 @@ void MenuHost::OnCaptureChanged(HWND hwnd) {
#endif
}
+void MenuHost::DoCapture() {
+ owns_capture_ = true;
+ SetCapture();
+ has_capture_ = true;
+#ifdef DEBUG_MENU
+ DLOG(INFO) << "Doing capture";
+#endif
+}
+
void MenuHost::ReleaseCapture() {
if (owns_capture_) {
#ifdef DEBUG_MENU