summaryrefslogtreecommitdiffstats
path: root/ash/launcher/launcher_context_menu.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-12 20:40:56 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-12 20:40:56 +0000
commit9628e0afd55f6f621ad6715fd3c394e4d435163b (patch)
treeac34b3fd7c82c17e70e7ae4ad139784e60b460b6 /ash/launcher/launcher_context_menu.h
parent0c1fb48686d1cf0dd91d6f121db2e4c6446c9336 (diff)
downloadchromium_src-9628e0afd55f6f621ad6715fd3c394e4d435163b.zip
chromium_src-9628e0afd55f6f621ad6715fd3c394e4d435163b.tar.gz
chromium_src-9628e0afd55f6f621ad6715fd3c394e4d435163b.tar.bz2
Implements new semantics for launcher context menu. Gone are the three
items, and instead they're repalced with a single item. The behavior of the item changes depending upon whether in maximized mode or not. I've put the core functionality into ash so that ash_shell now gets the context menu too. BUG=120947 TEST=see bug, also covered by tests. R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10069023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132048 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/launcher/launcher_context_menu.h')
-rw-r--r--ash/launcher/launcher_context_menu.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/ash/launcher/launcher_context_menu.h b/ash/launcher/launcher_context_menu.h
new file mode 100644
index 0000000..a7f638f
--- /dev/null
+++ b/ash/launcher/launcher_context_menu.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2012 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_WM_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_
+#define ASH_WM_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_
+#pragma once
+
+#include "ash/ash_export.h"
+#include "base/basictypes.h"
+#include "ui/base/models/simple_menu_model.h"
+
+namespace ash {
+
+// Context menu for the launcher.
+class ASH_EXPORT LauncherContextMenu : public ui::SimpleMenuModel,
+ public ui::SimpleMenuModel::Delegate {
+ public:
+ LauncherContextMenu();
+ virtual ~LauncherContextMenu();
+
+ // Returns true if the auto-hide menu item is checked.
+ static bool IsAutoHideMenuHideChecked();
+
+ // Toggles the state of the auto-hide menu item.
+ static void ToggleAutoHideMenu();
+
+ // Returns the resource id for the auto-hide menu.
+ static int GetAutoHideResourceStringId();
+
+ // 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) OVERRIDE;
+
+ private:
+ enum MenuItem {
+ MENU_AUTO_HIDE,
+ };
+
+ DISALLOW_COPY_AND_ASSIGN(LauncherContextMenu);
+};
+
+} // namespace ash
+
+#endif // ASH_WM_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_