Chromium Code Reviews| Index: views/controls/menu/native_menu_wayland.h |
| diff --git a/views/controls/menu/native_menu_wayland.h b/views/controls/menu/native_menu_wayland.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..83217b875ce12966cec125fb8badf02a29c4a84b |
| --- /dev/null |
| +++ b/views/controls/menu/native_menu_wayland.h |
| @@ -0,0 +1,55 @@ |
| +// 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_NATIVE_MENU_WAYLAND_H_ |
|
sadrul
2011/08/15 14:50:23
Is there anything wayland-y in here? Or can you co
|
| +#define VIEWS_CONTROLS_MENU_NATIVE_MENU_WAYLAND_H_ |
| +#pragma once |
| + |
| +#include "views/controls/menu/menu_delegate.h" |
| +#include "views/controls/menu/menu_item_view.h" |
| +#include "views/controls/menu/menu_wrapper.h" |
| + |
| +namespace ui { |
| +class MenuModel; |
| +} |
| + |
| +namespace views { |
| + |
| +class NativeMenuWayland : public MenuWrapper, |
| + public MenuDelegate { |
| + public: |
| + explicit NativeMenuWayland(Menu2* menu); |
| + virtual ~NativeMenuWayland(); |
| + |
| + // Overridden from MenuWrapper: |
| + virtual void RunMenuAt(const gfx::Point& point, int alignment); |
| + virtual void CancelMenu(); |
| + virtual void Rebuild(); |
| + virtual void UpdateStates(); |
| + virtual gfx::NativeMenu GetNativeMenu() const; |
| + virtual MenuAction GetMenuAction() const; |
| + virtual void AddMenuListener(MenuListener* listener); |
| + virtual void RemoveMenuListener(MenuListener* listener); |
| + virtual void SetMinimumWidth(int width); |
| + |
| + // Overridden from MenuDelegate: |
| + virtual bool IsItemChecked(int id) const; |
| + virtual bool IsCommandEnabled(int id) const; |
| + virtual void ExecuteCommand(int id); |
| + virtual bool GetAccelerator(int id, views::Accelerator* accelerator); |
| + |
| + private: |
| + void AddMenuItemsFromModel(MenuItemView* parent, ui::MenuModel* model); |
| + void UpdateMenuFromModel(SubmenuView* menu, ui::MenuModel* model); |
| + |
| + // The attached model and delegate. Does not assume ownership. |
| + ui::MenuModel* model_; |
| + scoped_ptr<MenuItemView> root_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(NativeMenuWayland); |
| +}; |
| + |
| +} // namespace views |
| + |
| +#endif // VIEWS_CONTROLS_MENU_NATIVE_MENU_WAYLAND_H_ |