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 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "ui/aura/aura_export.h" | 15 #include "ui/aura/aura_export.h" |
16 #include "ui/aura/client/capture_delegate.h" | 16 #include "ui/aura/client/capture_delegate.h" |
17 #include "ui/aura/root_window_host_delegate.h" | 17 #include "ui/aura/root_window_host_delegate.h" |
18 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
19 #include "ui/base/cursor/cursor.h" | 19 #include "ui/base/cursor/cursor.h" |
20 #include "ui/base/events/event_constants.h" | 20 #include "ui/base/events/event_constants.h" |
21 #include "ui/base/events/event_dispatcher.h" | 21 #include "ui/base/events/event_dispatcher.h" |
22 #include "ui/base/gestures/gesture_recognizer.h" | 22 #include "ui/base/gestures/gesture_recognizer.h" |
23 #include "ui/base/gestures/gesture_types.h" | 23 #include "ui/base/gestures/gesture_types.h" |
24 #include "ui/compositor/compositor.h" | 24 #include "ui/compositor/compositor.h" |
25 #include "ui/compositor/compositor_observer.h" | 25 #include "ui/compositor/compositor_observer.h" |
26 #include "ui/compositor/layer_animation_observer.h" | 26 #include "ui/compositor/layer_animation_observer.h" |
27 #include "ui/gfx/native_widget_types.h" | 27 #include "ui/gfx/native_widget_types.h" |
28 #include "ui/gfx/point.h" | 28 #include "ui/gfx/point.h" |
29 | 29 |
| 30 class SkCanvas; |
| 31 |
30 namespace gfx { | 32 namespace gfx { |
31 class Size; | 33 class Size; |
32 class Transform; | 34 class Transform; |
33 } | 35 } |
34 | 36 |
35 namespace ui { | 37 namespace ui { |
36 class GestureEvent; | 38 class GestureEvent; |
37 class GestureRecognizer; | 39 class GestureRecognizer; |
38 class KeyEvent; | 40 class KeyEvent; |
39 class LayerAnimationSequence; | 41 class LayerAnimationSequence; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // once the resize is completed. | 208 // once the resize is completed. |
207 // | 209 // |
208 // More than one hold can be invoked and each hold must be cancelled by a | 210 // More than one hold can be invoked and each hold must be cancelled by a |
209 // release before we resume normal operation. | 211 // release before we resume normal operation. |
210 void HoldMouseMoves(); | 212 void HoldMouseMoves(); |
211 void ReleaseMouseMoves(); | 213 void ReleaseMouseMoves(); |
212 | 214 |
213 // Sets if the window should be focused when shown. | 215 // Sets if the window should be focused when shown. |
214 void SetFocusWhenShown(bool focus_when_shown); | 216 void SetFocusWhenShown(bool focus_when_shown); |
215 | 217 |
216 // Grabs the snapshot of the root window by using the platform-dependent APIs. | 218 // Copies |source_bounds| from the root window (as displayed on the host |
| 219 // machine) to |canvas| at offset |dest_offset|. |
| 220 bool CopyAreaToSkCanvas(const gfx::Rect& source_bounds, |
| 221 const gfx::Point& dest_offset, |
| 222 SkCanvas* canvas); |
| 223 |
| 224 // Grabs a snapshot of the root window using platform-specific APIs, encodes |
| 225 // it in PNG format, and saves it to |png_representation|. |
217 bool GrabSnapshot(const gfx::Rect& snapshot_bounds, | 226 bool GrabSnapshot(const gfx::Rect& snapshot_bounds, |
218 std::vector<unsigned char>* png_representation); | 227 std::vector<unsigned char>* png_representation); |
219 | 228 |
220 // Gets the last location seen in a mouse event in this root window's | 229 // Gets the last location seen in a mouse event in this root window's |
221 // coordinates. This may return a point outside the root window's bounds. | 230 // coordinates. This may return a point outside the root window's bounds. |
222 gfx::Point GetLastMouseLocationInRoot() const; | 231 gfx::Point GetLastMouseLocationInRoot() const; |
223 | 232 |
224 // Overridden from Window: | 233 // Overridden from Window: |
225 virtual RootWindow* GetRootWindow() OVERRIDE; | 234 virtual RootWindow* GetRootWindow() OVERRIDE; |
226 virtual const RootWindow* GetRootWindow() const OVERRIDE; | 235 virtual const RootWindow* GetRootWindow() const OVERRIDE; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 base::WeakPtrFactory<RootWindow> held_mouse_event_factory_; | 386 base::WeakPtrFactory<RootWindow> held_mouse_event_factory_; |
378 | 387 |
379 scoped_ptr<ui::ViewProp> prop_; | 388 scoped_ptr<ui::ViewProp> prop_; |
380 | 389 |
381 DISALLOW_COPY_AND_ASSIGN(RootWindow); | 390 DISALLOW_COPY_AND_ASSIGN(RootWindow); |
382 }; | 391 }; |
383 | 392 |
384 } // namespace aura | 393 } // namespace aura |
385 | 394 |
386 #endif // UI_AURA_ROOT_WINDOW_H_ | 395 #endif // UI_AURA_ROOT_WINDOW_H_ |
OLD | NEW |