chromeos: bluetooth: add BluetoothNodeClient
[chromium-blink-merge.git] / ash / wm / workspace_controller.h
blob7ea212b60c40a798a9ea393bf6a40085268d879b
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ASH_WM_WORKSPACE_CONTROLLER_H_
6 #define ASH_WM_WORKSPACE_CONTROLLER_H_
7 #pragma once
9 #include "ash/ash_export.h"
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "ui/aura/root_window_observer.h"
13 #include "ui/aura/window_observer.h"
14 #include "ui/base/models/simple_menu_model.h"
16 namespace aura {
17 class Window;
20 namespace gfx {
21 class Point;
22 class Size;
25 namespace views {
26 class MenuRunner;
27 class Widget;
30 namespace ash {
31 namespace internal {
33 class WorkspaceEventFilter;
34 class WorkspaceLayoutManager;
35 class WorkspaceManager;
37 // WorkspaceController acts as a central place that ties together all the
38 // various workspace pieces: WorkspaceManager, WorkspaceLayoutManager and
39 // WorkspaceEventFilter.
40 class ASH_EXPORT WorkspaceController :
41 public aura::RootWindowObserver,
42 public aura::WindowObserver,
43 public ui::SimpleMenuModel::Delegate {
44 public:
45 explicit WorkspaceController(aura::Window* viewport);
46 virtual ~WorkspaceController();
48 void ToggleOverview();
50 // Returns the workspace manager that this controler owns.
51 WorkspaceManager* workspace_manager() {
52 return workspace_manager_.get();
55 // Shows the menu allowing you to configure various aspects of workspaces.
56 void ShowMenu(views::Widget* widget, const gfx::Point& location);
58 // aura::RootWindowObserver overrides:
59 virtual void OnRootWindowResized(const gfx::Size& new_size) OVERRIDE;
61 // aura::WindowObserver overrides:
62 virtual void OnWindowPropertyChanged(aura::Window* window,
63 const void* key,
64 intptr_t old) OVERRIDE;
66 // ui::SimpleMenuModel::Delegate overrides:
67 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
68 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
69 virtual void ExecuteCommand(int command_id) OVERRIDE;
70 virtual bool GetAcceleratorForCommandId(
71 int command_id,
72 ui::Accelerator* accelerator) OVERRIDE;
74 private:
75 enum MenuItem {
76 MENU_SNAP_TO_GRID,
77 MENU_OPEN_MAXIMIZED,
80 aura::Window* viewport_;
82 scoped_ptr<WorkspaceManager> workspace_manager_;
84 // Owned by the window its attached to.
85 WorkspaceLayoutManager* layout_manager_;
87 // Owned by |viewport_|.
88 WorkspaceEventFilter* event_filter_;
90 #if !defined(OS_MACOSX)
91 scoped_ptr<views::MenuRunner> menu_runner_;
92 #endif
94 DISALLOW_COPY_AND_ASSIGN(WorkspaceController);
97 } // namespace internal
98 } // namespace ash
100 #endif // ASH_WM_WORKSPACE_CONTROLLER_H_