summaryrefslogtreecommitdiffstats
path: root/views/controls/menu/menu_host_gtk.h
blob: ac1e5887e11cc32a758dc25add7573a9bac8048d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.


#ifndef VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_
#define VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_
#pragma once

#include "views/controls/menu/native_menu_host.h"
#include "views/widget/widget_gtk.h"

namespace views {
namespace internal {
class NativeMenuHostDelegate;
}

// NativeMenuHost implementation for Gtk.
class MenuHostGtk : public WidgetGtk,
                    public NativeMenuHost {
 public:
  explicit MenuHostGtk(internal::NativeMenuHostDelegate* delegate);
  virtual ~MenuHostGtk();

 private:
  // Overridden from NativeMenuHost:
  virtual void StartCapturing() OVERRIDE;
  virtual NativeWidget* AsNativeWidget() OVERRIDE;

  // Overridden from WidgetGtk:
  virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE;
  virtual void ReleaseMouseCapture() OVERRIDE;
  virtual void OnDestroy(GtkWidget* object) OVERRIDE;
  virtual void HandleGtkGrabBroke() OVERRIDE;
  virtual void HandleXGrabBroke() OVERRIDE;

  // Have we done input grab?
  bool did_input_grab_;

  internal::NativeMenuHostDelegate* delegate_;

  DISALLOW_COPY_AND_ASSIGN(MenuHostGtk);
};

}  // namespace views

#endif  // VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_