| 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_HOST_WIN_H_ | 5 #ifndef VIEWS_CONTROLS_MENU_MENU_HOST_WIN_H_ |
| 6 #define VIEWS_CONTROLS_MENU_MENU_HOST_WIN_H_ | 6 #define VIEWS_CONTROLS_MENU_MENU_HOST_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "views/controls/menu/native_menu_host.h" | 9 #include "views/controls/menu/native_menu_host.h" |
| 10 #include "views/widget/widget_win.h" | 10 #include "views/widget/widget_win.h" |
| 11 | 11 |
| 12 namespace views { | 12 namespace views { |
| 13 namespace internal { | 13 namespace internal { |
| 14 class NativeMenuHostDelegate; | 14 class NativeMenuHostDelegate; |
| 15 } | 15 } |
| 16 | 16 |
| 17 // MenuHost implementation for windows. | 17 // MenuHost implementation for windows. |
| 18 class MenuHostWin : public WidgetWin, | 18 class MenuHostWin : public WidgetWin, |
| 19 public NativeMenuHost { | 19 public NativeMenuHost { |
| 20 public: | 20 public: |
| 21 explicit MenuHostWin(internal::NativeMenuHostDelegate* delegate); | 21 explicit MenuHostWin(internal::NativeMenuHostDelegate* delegate); |
| 22 virtual ~MenuHostWin(); | 22 virtual ~MenuHostWin(); |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 // Overridden from NativeMenuHost: | 25 // Overridden from NativeMenuHost: |
| 26 virtual void InitMenuHost(gfx::NativeWindow parent, | |
| 27 const gfx::Rect& bounds) OVERRIDE; | |
| 28 virtual void StartCapturing() OVERRIDE; | 26 virtual void StartCapturing() OVERRIDE; |
| 29 virtual NativeWidget* AsNativeWidget() OVERRIDE; | 27 virtual NativeWidget* AsNativeWidget() OVERRIDE; |
| 30 | 28 |
| 31 // Overridden from WidgetWin: | 29 // Overridden from WidgetWin: |
| 32 virtual void OnDestroy() OVERRIDE; | 30 virtual void OnDestroy() OVERRIDE; |
| 33 virtual void OnCancelMode() OVERRIDE; | 31 virtual void OnCancelMode() OVERRIDE; |
| 34 virtual RootView* CreateRootView() OVERRIDE; | 32 virtual RootView* CreateRootView() OVERRIDE; |
| 35 virtual bool ShouldReleaseCaptureOnMouseReleased() const OVERRIDE; | 33 virtual bool ShouldReleaseCaptureOnMouseReleased() const OVERRIDE; |
| 36 | 34 |
| 37 scoped_ptr<internal::NativeMenuHostDelegate> delegate_; | 35 scoped_ptr<internal::NativeMenuHostDelegate> delegate_; |
| 38 | 36 |
| 39 DISALLOW_COPY_AND_ASSIGN(MenuHostWin); | 37 DISALLOW_COPY_AND_ASSIGN(MenuHostWin); |
| 40 }; | 38 }; |
| 41 | 39 |
| 42 } // namespace views | 40 } // namespace views |
| 43 | 41 |
| 44 #endif // VIEWS_CONTROLS_MENU_MENU_HOST_WIN_H_ | 42 #endif // VIEWS_CONTROLS_MENU_MENU_HOST_WIN_H_ |
| OLD | NEW |