Chromium Code Reviews| Index: ash/shelf/shelf_item_context_menu.h |
| diff --git a/ash/shelf/shelf_item_context_menu.h b/ash/shelf/shelf_item_context_menu.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4d2373b1baf4152aabbe0284fb0118a742dcad11 |
| --- /dev/null |
| +++ b/ash/shelf/shelf_item_context_menu.h |
| @@ -0,0 +1,74 @@ |
| +// Copyright 2013 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 ASH_SHELF_SHELF_ITEM_CONTEXT_MENU_H_ |
| +#define ASH_SHELF_SHELF_ITEM_CONTEXT_MENU_H_ |
| + |
| +#include "ash/shelf/shelf_alignment_menu.h" |
| +#include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| + |
| +namespace aura { |
| +class Window; |
| +} |
| + |
| +namespace ash { |
| + |
| +class Shell; |
| + |
| +namespace internal { |
| + |
| +class ShelfWindowWatcherItemDelegate; |
| + |
| +// Context menu shown for an item created by ShelfWindowWatcher. |
| +class ShelfItemContextMenu : public ui::SimpleMenuModel, |
| + public ui::SimpleMenuModel::Delegate { |
| + public: |
| + ShelfItemContextMenu(ShelfWindowWatcherItemDelegate* item_delegate, |
| + aura::Window* root_window); |
| + |
| + virtual ~ShelfItemContextMenu(); |
| + |
| + void Init(); |
| + |
| + // ui::SimpleMenuModel::Delegate overrides: |
| + virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
| + virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
| + virtual bool GetAcceleratorForCommandId( |
| + int command_id, |
| + ui::Accelerator* accelerator) OVERRIDE; |
| + virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; |
| + |
| + private: |
| + enum MenuItem { |
| + MENU_CLOSE, |
| + MENU_AUTO_HIDE, |
| + MENU_ALIGNMENT_MENU, |
| +#if defined(OS_CHROMEOS) |
| + MENU_CHANGE_WALLPAPER, |
| +#endif |
| + }; |
| + |
| + // Returns true if there is a full screen window. |
| + bool IsFullScreenMode() const; |
| + |
| + // Toggles ShelfAutoHideBehavior. |
| + void ToggleShelfAutoHideBehavior() const; |
| + |
| + // Owned by ShelfItemDelegateManager. |
| + ShelfWindowWatcherItemDelegate* item_delegate_; |
| + |
| + // Not owned. |
| + aura::Window* root_window_; |
| + ash::Shell* shell_; |
|
sky
2013/12/16 21:09:44
Why not use Shell::GetInstance() instead of cachin
|
| + |
| + ash::ShelfAlignmentMenu shelf_alignment_menu_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ShelfItemContextMenu); |
| +}; |
| + |
| +} // namespace internal |
| +} // namespace ash |
| + |
| +#endif // ASH_SHELF_SHELF_ITEM_CONTEXT_MENU_H_ |