| 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 UI_AURA_ROOT_WINDOW_H_ | 5 #ifndef UI_AURA_ROOT_WINDOW_H_ |
| 6 #define UI_AURA_ROOT_WINDOW_H_ | 6 #define UI_AURA_ROOT_WINDOW_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/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "ui/aura/aura_export.h" | 14 #include "ui/aura/aura_export.h" |
| 15 #include "ui/aura/dip_util.h" | |
| 16 #include "ui/aura/focus_manager.h" | 15 #include "ui/aura/focus_manager.h" |
| 17 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 18 #include "ui/base/cursor/cursor.h" | 17 #include "ui/base/cursor/cursor.h" |
| 19 #include "ui/base/events.h" | 18 #include "ui/base/events.h" |
| 20 #include "ui/base/gestures/gesture_recognizer.h" | 19 #include "ui/base/gestures/gesture_recognizer.h" |
| 21 #include "ui/base/gestures/gesture_types.h" | 20 #include "ui/base/gestures/gesture_types.h" |
| 22 #include "ui/gfx/compositor/compositor.h" | 21 #include "ui/gfx/compositor/compositor.h" |
| 23 #include "ui/gfx/compositor/compositor_observer.h" | 22 #include "ui/gfx/compositor/compositor_observer.h" |
| 24 #include "ui/gfx/compositor/layer_animation_observer.h" | 23 #include "ui/gfx/compositor/layer_animation_observer.h" |
| 25 #include "ui/gfx/native_widget_types.h" | 24 #include "ui/gfx/native_widget_types.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 Window* capture_window() { return capture_window_; } | 97 Window* capture_window() { return capture_window_; } |
| 99 Window* focused_window() { return focused_window_; } | 98 Window* focused_window() { return focused_window_; } |
| 100 | 99 |
| 101 // Initializes the root window. | 100 // Initializes the root window. |
| 102 void Init(); | 101 void Init(); |
| 103 | 102 |
| 104 // Shows the root window host. | 103 // Shows the root window host. |
| 105 void ShowRootWindow(); | 104 void ShowRootWindow(); |
| 106 | 105 |
| 107 // Sets the size of the root window. | 106 // Sets the size of the root window. |
| 108 void SetHostSize(const gfx::Size& size); | 107 void SetHostSize(const gfx::Size& size_in_pixel); |
| 109 gfx::Size GetHostSize() const; | 108 gfx::Size GetHostSize() const; |
| 110 | 109 |
| 111 // Sets the bounds of the host window. | 110 // Sets the bounds of the host window. |
| 112 void SetHostBounds(const gfx::Rect& size); | 111 void SetHostBounds(const gfx::Rect& size_in_pixel); |
| 113 | 112 |
| 114 // Returns where the RootWindow is on screen. | 113 // Returns where the RootWindow is on screen. |
| 115 gfx::Point GetHostOrigin() const; | 114 gfx::Point GetHostOrigin() const; |
| 116 | 115 |
| 117 // Sets the currently-displayed cursor. If the cursor was previously hidden | 116 // Sets the currently-displayed cursor. If the cursor was previously hidden |
| 118 // via ShowCursor(false), it will remain hidden until ShowCursor(true) is | 117 // via ShowCursor(false), it will remain hidden until ShowCursor(true) is |
| 119 // called, at which point the cursor that was last set via SetCursor() will be | 118 // called, at which point the cursor that was last set via SetCursor() will be |
| 120 // used. | 119 // used. |
| 121 void SetCursor(gfx::NativeCursor cursor); | 120 void SetCursor(gfx::NativeCursor cursor); |
| 122 | 121 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 148 | 147 |
| 149 // Handles a touch event. Returns true if handled. | 148 // Handles a touch event. Returns true if handled. |
| 150 bool DispatchTouchEvent(TouchEvent* event); | 149 bool DispatchTouchEvent(TouchEvent* event); |
| 151 | 150 |
| 152 // Handles a gesture event. Returns true if handled. Unlike the other | 151 // Handles a gesture event. Returns true if handled. Unlike the other |
| 153 // event-dispatching function (e.g. for touch/mouse/keyboard events), gesture | 152 // event-dispatching function (e.g. for touch/mouse/keyboard events), gesture |
| 154 // events are dispatched from GestureRecognizer instead of RootWindowHost. | 153 // events are dispatched from GestureRecognizer instead of RootWindowHost. |
| 155 bool DispatchGestureEvent(GestureEvent* event); | 154 bool DispatchGestureEvent(GestureEvent* event); |
| 156 | 155 |
| 157 // Called when the host changes size. | 156 // Called when the host changes size. |
| 158 void OnHostResized(const gfx::Size& size); | 157 void OnHostResized(const gfx::Size& size_in_pixel); |
| 159 | 158 |
| 160 // Invoked when |window| is being destroyed. | 159 // Invoked when |window| is being destroyed. |
| 161 void OnWindowDestroying(Window* window); | 160 void OnWindowDestroying(Window* window); |
| 162 | 161 |
| 163 // Invoked when |window|'s bounds have changed. |contained_mouse| indicates if | 162 // Invoked when |window|'s bounds have changed. |contained_mouse| indicates if |
| 164 // the bounds before change contained the |last_moust_location()|. | 163 // the bounds before change contained the |last_moust_location()|. |
| 165 void OnWindowBoundsChanged(Window* window, bool contained_mouse); | 164 void OnWindowBoundsChanged(Window* window, bool contained_mouse); |
| 166 | 165 |
| 167 // Invoked when |window|'s visibility is changed. | 166 // Invoked when |window|'s visibility is changed. |
| 168 void OnWindowVisibilityChanged(Window* window, bool is_visible); | 167 void OnWindowVisibilityChanged(Window* window, bool is_visible); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 bool draw_on_compositor_unlock_; | 403 bool draw_on_compositor_unlock_; |
| 405 | 404 |
| 406 int draw_trace_count_; | 405 int draw_trace_count_; |
| 407 | 406 |
| 408 DISALLOW_COPY_AND_ASSIGN(RootWindow); | 407 DISALLOW_COPY_AND_ASSIGN(RootWindow); |
| 409 }; | 408 }; |
| 410 | 409 |
| 411 } // namespace aura | 410 } // namespace aura |
| 412 | 411 |
| 413 #endif // UI_AURA_ROOT_WINDOW_H_ | 412 #endif // UI_AURA_ROOT_WINDOW_H_ |
| OLD | NEW |