| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_AURA_DESKTOP_H_ | 5 #ifndef UI_AURA_DESKTOP_H_ |
| 6 #define UI_AURA_DESKTOP_H_ | 6 #define UI_AURA_DESKTOP_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/task.h" | 13 #include "base/task.h" |
| 14 #include "ui/aura/aura_export.h" | 14 #include "ui/aura/aura_export.h" |
| 15 #include "ui/aura/cursor.h" | 15 #include "ui/aura/cursor.h" |
| 16 #include "ui/aura/focus_manager.h" | 16 #include "ui/aura/focus_manager.h" |
| 17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 18 #include "ui/base/events.h" | 18 #include "ui/base/events.h" |
| 19 #include "ui/gfx/compositor/compositor.h" | 19 #include "ui/gfx/compositor/compositor.h" |
| 20 #include "ui/gfx/compositor/layer_animation_observer.h" |
| 20 #include "ui/gfx/native_widget_types.h" | 21 #include "ui/gfx/native_widget_types.h" |
| 21 #include "ui/gfx/point.h" | 22 #include "ui/gfx/point.h" |
| 22 | 23 |
| 23 namespace gfx { | 24 namespace gfx { |
| 24 class Size; | 25 class Size; |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace ui { | 28 namespace ui { |
| 28 class LayerAnimationSequence; | 29 class LayerAnimationSequence; |
| 29 class Transform; | 30 class Transform; |
| 30 } | 31 } |
| 31 | 32 |
| 32 namespace aura { | 33 namespace aura { |
| 33 | 34 |
| 34 class DesktopDelegate; | 35 class DesktopDelegate; |
| 35 class DesktopHost; | 36 class DesktopHost; |
| 36 class DesktopObserver; | 37 class DesktopObserver; |
| 37 class KeyEvent; | 38 class KeyEvent; |
| 38 class MouseEvent; | 39 class MouseEvent; |
| 39 class ScreenAura; | 40 class ScreenAura; |
| 40 class TouchEvent; | 41 class TouchEvent; |
| 41 | 42 |
| 42 // Desktop is responsible for hosting a set of windows. | 43 // Desktop is responsible for hosting a set of windows. |
| 43 class AURA_EXPORT Desktop : public ui::CompositorDelegate, | 44 class AURA_EXPORT Desktop : public ui::CompositorDelegate, |
| 44 public Window, | 45 public Window, |
| 45 public internal::FocusManager { | 46 public internal::FocusManager, |
| 47 public ui::LayerAnimationObserver { |
| 46 public: | 48 public: |
| 47 Desktop(); | 49 Desktop(); |
| 48 virtual ~Desktop(); | 50 virtual ~Desktop(); |
| 49 | 51 |
| 50 static Desktop* GetInstance(); | 52 static Desktop* GetInstance(); |
| 51 static void DeleteInstanceForTesting(); | 53 static void DeleteInstanceForTesting(); |
| 52 | 54 |
| 53 static void set_use_fullscreen_host_window(bool use_fullscreen) { | 55 static void set_use_fullscreen_host_window(bool use_fullscreen) { |
| 54 use_fullscreen_host_window_ = use_fullscreen; | 56 use_fullscreen_host_window_ = use_fullscreen; |
| 55 } | 57 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 ui::TouchStatus ProcessTouchEvent(Window* target, TouchEvent* event); | 141 ui::TouchStatus ProcessTouchEvent(Window* target, TouchEvent* event); |
| 140 | 142 |
| 141 // Overridden from ui::CompositorDelegate | 143 // Overridden from ui::CompositorDelegate |
| 142 virtual void ScheduleDraw(); | 144 virtual void ScheduleDraw(); |
| 143 | 145 |
| 144 // Overridden from Window: | 146 // Overridden from Window: |
| 145 virtual bool CanFocus() const OVERRIDE; | 147 virtual bool CanFocus() const OVERRIDE; |
| 146 virtual internal::FocusManager* GetFocusManager() OVERRIDE; | 148 virtual internal::FocusManager* GetFocusManager() OVERRIDE; |
| 147 virtual Desktop* GetDesktop() OVERRIDE; | 149 virtual Desktop* GetDesktop() OVERRIDE; |
| 148 | 150 |
| 149 // Overridden from ui::LayerDelegate: | 151 // Overridden from ui::LayerAnimationObserver: |
| 150 virtual void OnLayerAnimationEnded( | 152 virtual void OnLayerAnimationEnded( |
| 151 const ui::LayerAnimationSequence* animation) OVERRIDE; | 153 const ui::LayerAnimationSequence* animation) OVERRIDE; |
| 154 virtual void OnLayerAnimationScheduled( |
| 155 const ui::LayerAnimationSequence* animation) OVERRIDE; |
| 156 virtual void OnLayerAnimationAborted( |
| 157 const ui::LayerAnimationSequence* animation) OVERRIDE; |
| 152 | 158 |
| 153 // Overridden from FocusManager: | 159 // Overridden from FocusManager: |
| 154 virtual void SetFocusedWindow(Window* window) OVERRIDE; | 160 virtual void SetFocusedWindow(Window* window) OVERRIDE; |
| 155 virtual Window* GetFocusedWindow() OVERRIDE; | 161 virtual Window* GetFocusedWindow() OVERRIDE; |
| 156 virtual bool IsFocusedWindow(const Window* window) const OVERRIDE; | 162 virtual bool IsFocusedWindow(const Window* window) const OVERRIDE; |
| 157 | 163 |
| 158 // Initializes the desktop. | 164 // Initializes the desktop. |
| 159 void Init(); | 165 void Init(); |
| 160 | 166 |
| 161 // Parses the switch describing the initial size for the host window and | 167 // Parses the switch describing the initial size for the host window and |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 Window* mouse_moved_handler_; | 205 Window* mouse_moved_handler_; |
| 200 Window* focused_window_; | 206 Window* focused_window_; |
| 201 Window* touch_event_handler_; | 207 Window* touch_event_handler_; |
| 202 | 208 |
| 203 DISALLOW_COPY_AND_ASSIGN(Desktop); | 209 DISALLOW_COPY_AND_ASSIGN(Desktop); |
| 204 }; | 210 }; |
| 205 | 211 |
| 206 } // namespace aura | 212 } // namespace aura |
| 207 | 213 |
| 208 #endif // UI_AURA_DESKTOP_H_ | 214 #endif // UI_AURA_DESKTOP_H_ |
| OLD | NEW |