diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-24 15:46:45 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-24 15:46:45 +0000 |
commit | a87ecb3c7170caa40810def524fbae1aee4d3533 (patch) | |
tree | 947732a745f124feda7ace8ac466cf75c746db62 /views/controls/menu/menu_host_gtk.h | |
parent | de1b764f404e5fb6975e7cc9de7120d46e28dcfd (diff) | |
download | chromium_src-a87ecb3c7170caa40810def524fbae1aee4d3533.zip chromium_src-a87ecb3c7170caa40810def524fbae1aee4d3533.tar.gz chromium_src-a87ecb3c7170caa40810def524fbae1aee4d3533.tar.bz2 |
Further refactoring of menus for GTK. I've now separated out
everything and menus some what work on GTK. I need to get painting
working and I'm sure there will be fine tuning, but I want to check in
all this splitting of files before someone else needs change one of
these files.
Thankfully I wrote an interactive ui test that exercises much of this code, and it still passes:)
BUG=none
TEST=thoroughly test bookmark menus on windows to make sure I didn't
break them.
Review URL: http://codereview.chromium.org/174274
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24098 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/menu/menu_host_gtk.h')
-rw-r--r-- | views/controls/menu/menu_host_gtk.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/views/controls/menu/menu_host_gtk.h b/views/controls/menu/menu_host_gtk.h new file mode 100644 index 0000000..545acb5 --- /dev/null +++ b/views/controls/menu/menu_host_gtk.h @@ -0,0 +1,51 @@ +// Copyright (c) 2009 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_ + +#include "views/widget/widget_gtk.h" + +namespace views { + +class SubmenuView; + +// MenuHost implementation for Gtk. +class MenuHost : public WidgetGtk { + public: + explicit MenuHost(SubmenuView* submenu); + + void Init(gfx::NativeView parent, + const gfx::Rect& bounds, + View* contents_view, + bool do_capture); + + void Show(); + virtual void Hide(); + virtual void HideWindow(); + void ReleaseCapture(); + + protected: + virtual RootView* CreateRootView(); + + virtual void OnCancelMode(); + + // Overriden to return false, we do NOT want to release capture on mouse + // release. + virtual bool ReleaseCaptureOnMouseReleased(); + + private: + // If true, we've been closed. + bool closed_; + + // The view we contain. + SubmenuView* submenu_; + + DISALLOW_COPY_AND_ASSIGN(MenuHost); +}; + +} // namespace views + +#endif // VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ |