| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_SHELL_H_ | 5 #ifndef ASH_SHELL_H_ |
| 6 #define ASH_SHELL_H_ | 6 #define ASH_SHELL_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "ash/system/user/login_status.h" | 12 #include "ash/system/user/login_status.h" |
| 13 #include "ash/wm/cursor_manager.h" | 13 #include "ash/wm/cursor_manager.h" |
| 14 #include "ash/wm/shelf_types.h" | 14 #include "ash/wm/shelf_types.h" |
| 15 #include "ash/wm/system_modal_container_event_filter_delegate.h" | 15 #include "ash/wm/system_modal_container_event_filter_delegate.h" |
| 16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 18 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
| 19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "ui/base/events/event_target.h" |
| 21 #include "ui/gfx/insets.h" | 22 #include "ui/gfx/insets.h" |
| 22 #include "ui/gfx/screen.h" | 23 #include "ui/gfx/screen.h" |
| 23 #include "ui/gfx/size.h" | 24 #include "ui/gfx/size.h" |
| 24 | 25 |
| 25 class CommandLine; | 26 class CommandLine; |
| 26 | 27 |
| 27 namespace aura { | 28 namespace aura { |
| 28 class EventFilter; | 29 class EventFilter; |
| 29 class FocusManager; | 30 class FocusManager; |
| 30 class RootWindow; | 31 class RootWindow; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 class VisibilityController; | 109 class VisibilityController; |
| 109 class WindowModalityController; | 110 class WindowModalityController; |
| 110 class WorkspaceController; | 111 class WorkspaceController; |
| 111 } | 112 } |
| 112 | 113 |
| 113 // Shell is a singleton object that presents the Shell API and implements the | 114 // Shell is a singleton object that presents the Shell API and implements the |
| 114 // RootWindow's delegate interface. | 115 // RootWindow's delegate interface. |
| 115 // | 116 // |
| 116 // Upon creation, the Shell sets itself as the RootWindow's delegate, which | 117 // Upon creation, the Shell sets itself as the RootWindow's delegate, which |
| 117 // takes ownership of the Shell. | 118 // takes ownership of the Shell. |
| 118 class ASH_EXPORT Shell : internal::SystemModalContainerEventFilterDelegate{ | 119 class ASH_EXPORT Shell : internal::SystemModalContainerEventFilterDelegate, |
| 120 public ui::EventTarget { |
| 119 public: | 121 public: |
| 120 typedef std::vector<aura::RootWindow*> RootWindowList; | 122 typedef std::vector<aura::RootWindow*> RootWindowList; |
| 121 typedef std::vector<internal::RootWindowController*> RootWindowControllerList; | 123 typedef std::vector<internal::RootWindowController*> RootWindowControllerList; |
| 122 | 124 |
| 123 enum Direction { | 125 enum Direction { |
| 124 FORWARD, | 126 FORWARD, |
| 125 BACKWARD | 127 BACKWARD |
| 126 }; | 128 }; |
| 127 | 129 |
| 128 // Accesses private data from a Shell for testing. | 130 // Accesses private data from a Shell for testing. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // all root windows. | 187 // all root windows. |
| 186 static std::vector<aura::Window*> GetAllContainers(int container_id); | 188 static std::vector<aura::Window*> GetAllContainers(int container_id); |
| 187 | 189 |
| 188 // True if "launcher per display" feature is enabled. | 190 // True if "launcher per display" feature is enabled. |
| 189 static bool IsLauncherPerDisplayEnabled(); | 191 static bool IsLauncherPerDisplayEnabled(); |
| 190 | 192 |
| 191 void set_active_root_window(aura::RootWindow* active_root_window) { | 193 void set_active_root_window(aura::RootWindow* active_root_window) { |
| 192 active_root_window_ = active_root_window; | 194 active_root_window_ = active_root_window; |
| 193 } | 195 } |
| 194 | 196 |
| 197 // Overridden from ui::EventTarget: |
| 198 virtual bool CanAcceptEvents() OVERRIDE; |
| 199 virtual EventTarget* GetParentTarget() OVERRIDE; |
| 200 |
| 195 // Adds or removes |filter| from the aura::Env's pre-target event-handler | 201 // Adds or removes |filter| from the aura::Env's pre-target event-handler |
| 196 // list. | 202 // list. |
| 197 void AddEnvEventFilter(aura::EventFilter* filter); | 203 void AddEnvEventFilter(aura::EventFilter* filter); |
| 198 void RemoveEnvEventFilter(aura::EventFilter* filter); | 204 void RemoveEnvEventFilter(aura::EventFilter* filter); |
| 199 | 205 |
| 200 // Shows the context menu for the background and launcher at | 206 // Shows the context menu for the background and launcher at |
| 201 // |location_in_screen| (in screen coordinates). | 207 // |location_in_screen| (in screen coordinates). |
| 202 void ShowContextMenu(const gfx::Point& location_in_screen); | 208 void ShowContextMenu(const gfx::Point& location_in_screen); |
| 203 | 209 |
| 204 // Toggles app list. | 210 // Toggles app list. |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 523 |
| 518 // For testing only: simulate that a modal window is open | 524 // For testing only: simulate that a modal window is open |
| 519 bool simulate_modal_window_open_for_testing_; | 525 bool simulate_modal_window_open_for_testing_; |
| 520 | 526 |
| 521 DISALLOW_COPY_AND_ASSIGN(Shell); | 527 DISALLOW_COPY_AND_ASSIGN(Shell); |
| 522 }; | 528 }; |
| 523 | 529 |
| 524 } // namespace ash | 530 } // namespace ash |
| 525 | 531 |
| 526 #endif // ASH_SHELL_H_ | 532 #endif // ASH_SHELL_H_ |
| OLD | NEW |