| 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 "views/controls/menu/native_menu_host_delegate.h" | 7 #include "views/controls/menu/native_menu_host_delegate.h" |
| 8 | 8 |
| 9 namespace views { | 9 namespace views { |
| 10 | 10 |
| 11 //////////////////////////////////////////////////////////////////////////////// | 11 //////////////////////////////////////////////////////////////////////////////// |
| 12 // MenuHostWin, public: | 12 // MenuHostWin, public: |
| 13 | 13 |
| 14 MenuHostWin::MenuHostWin(internal::NativeMenuHostDelegate* delegate) | 14 MenuHostWin::MenuHostWin(internal::NativeMenuHostDelegate* delegate) |
| 15 : delegate_(delegate) { | 15 : delegate_(delegate) { |
| 16 } | 16 } |
| 17 | 17 |
| 18 MenuHostWin::~MenuHostWin() { | 18 MenuHostWin::~MenuHostWin() { |
| 19 } | 19 } |
| 20 | 20 |
| 21 //////////////////////////////////////////////////////////////////////////////// | 21 //////////////////////////////////////////////////////////////////////////////// |
| 22 // MenuHostWin, NativeMenuHost implementation: | 22 // MenuHostWin, NativeMenuHost implementation: |
| 23 | 23 |
| 24 void MenuHostWin::InitMenuHost(gfx::NativeWindow parent, | |
| 25 const gfx::Rect& bounds) { | |
| 26 WidgetWin::Init(parent, bounds); | |
| 27 } | |
| 28 | |
| 29 void MenuHostWin::StartCapturing() { | 24 void MenuHostWin::StartCapturing() { |
| 30 SetMouseCapture(); | 25 SetMouseCapture(); |
| 31 } | 26 } |
| 32 | 27 |
| 33 NativeWidget* MenuHostWin::AsNativeWidget() { | 28 NativeWidget* MenuHostWin::AsNativeWidget() { |
| 34 return this; | 29 return this; |
| 35 } | 30 } |
| 36 | 31 |
| 37 //////////////////////////////////////////////////////////////////////////////// | 32 //////////////////////////////////////////////////////////////////////////////// |
| 38 // MenuHostWin, WidgetWin overrides: | 33 // MenuHostWin, WidgetWin overrides: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 60 //////////////////////////////////////////////////////////////////////////////// | 55 //////////////////////////////////////////////////////////////////////////////// |
| 61 // NativeMenuHost, public: | 56 // NativeMenuHost, public: |
| 62 | 57 |
| 63 // static | 58 // static |
| 64 NativeMenuHost* NativeMenuHost::CreateNativeMenuHost( | 59 NativeMenuHost* NativeMenuHost::CreateNativeMenuHost( |
| 65 internal::NativeMenuHostDelegate* delegate) { | 60 internal::NativeMenuHostDelegate* delegate) { |
| 66 return new MenuHostWin(delegate); | 61 return new MenuHostWin(delegate); |
| 67 } | 62 } |
| 68 | 63 |
| 69 } // namespace views | 64 } // namespace views |
| OLD | NEW |