Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3947)

Unified Diff: ash/shelf/shelf_item_context_menu.h

Issue 107163005: [ash] Add TYPE_DIALOG and its item's LauncherContextMenu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shelf/shelf_delegate.h ('k') | ash/shelf/shelf_item_context_menu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « ash/shelf/shelf_delegate.h ('k') | ash/shelf/shelf_item_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698