| 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 | 5 |
| 6 #ifndef VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ | 6 #ifndef VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ |
| 7 #define VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ | 7 #define VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ |
| 8 #pragma once | 8 #pragma once |
| 9 | 9 |
| 10 #include "views/controls/menu/native_menu_host.h" | 10 #include "views/controls/menu/native_menu_host.h" |
| 11 #include "views/widget/widget_gtk.h" | 11 #include "views/widget/widget_gtk.h" |
| 12 | 12 |
| 13 namespace views { | 13 namespace views { |
| 14 namespace internal { | 14 namespace internal { |
| 15 class NativeMenuHostDelegate; | 15 class NativeMenuHostDelegate; |
| 16 } | 16 } |
| 17 | 17 |
| 18 // NativeMenuHost implementation for Gtk. | 18 // NativeMenuHost implementation for Gtk. |
| 19 class MenuHostGtk : public WidgetGtk, | 19 class MenuHostGtk : public WidgetGtk, |
| 20 public NativeMenuHost { | 20 public NativeMenuHost { |
| 21 public: | 21 public: |
| 22 explicit MenuHostGtk(internal::NativeMenuHostDelegate* delegate); | 22 explicit MenuHostGtk(internal::NativeMenuHostDelegate* delegate); |
| 23 virtual ~MenuHostGtk(); | 23 virtual ~MenuHostGtk(); |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 // Overridden from NativeMenuHost: | 26 // Overridden from NativeMenuHost: |
| 27 virtual void InitMenuHost(gfx::NativeWindow parent, | |
| 28 const gfx::Rect& bounds) OVERRIDE; | |
| 29 virtual void StartCapturing() OVERRIDE; | 27 virtual void StartCapturing() OVERRIDE; |
| 30 virtual NativeWidget* AsNativeWidget() OVERRIDE; | 28 virtual NativeWidget* AsNativeWidget() OVERRIDE; |
| 31 | 29 |
| 32 // Overridden from WidgetGtk: | 30 // Overridden from WidgetGtk: |
| 31 virtual void InitNativeWidget(const Widget::CreateParams& params) OVERRIDE; |
| 33 virtual RootView* CreateRootView() OVERRIDE; | 32 virtual RootView* CreateRootView() OVERRIDE; |
| 34 virtual bool ShouldReleaseCaptureOnMouseReleased() const OVERRIDE; | 33 virtual bool ShouldReleaseCaptureOnMouseReleased() const OVERRIDE; |
| 35 virtual void ReleaseMouseCapture() OVERRIDE; | 34 virtual void ReleaseMouseCapture() OVERRIDE; |
| 36 virtual void OnDestroy(GtkWidget* object) OVERRIDE; | 35 virtual void OnDestroy(GtkWidget* object) OVERRIDE; |
| 37 virtual void HandleGtkGrabBroke() OVERRIDE; | 36 virtual void HandleGtkGrabBroke() OVERRIDE; |
| 38 virtual void HandleXGrabBroke() OVERRIDE; | 37 virtual void HandleXGrabBroke() OVERRIDE; |
| 39 | 38 |
| 40 // Have we done input grab? | 39 // Have we done input grab? |
| 41 bool did_input_grab_; | 40 bool did_input_grab_; |
| 42 | 41 |
| 43 scoped_ptr<internal::NativeMenuHostDelegate> delegate_; | 42 scoped_ptr<internal::NativeMenuHostDelegate> delegate_; |
| 44 | 43 |
| 45 DISALLOW_COPY_AND_ASSIGN(MenuHostGtk); | 44 DISALLOW_COPY_AND_ASSIGN(MenuHostGtk); |
| 46 }; | 45 }; |
| 47 | 46 |
| 48 } // namespace views | 47 } // namespace views |
| 49 | 48 |
| 50 #endif // VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ | 49 #endif // VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ |
| OLD | NEW |