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" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // A host to use in place of the default one that RootWindow will create. | 94 // A host to use in place of the default one that RootWindow will create. |
95 // NULL by default. | 95 // NULL by default. |
96 RootWindowHost* host; | 96 RootWindowHost* host; |
97 }; | 97 }; |
98 | 98 |
99 explicit RootWindow(const CreateParams& params); | 99 explicit RootWindow(const CreateParams& params); |
100 virtual ~RootWindow(); | 100 virtual ~RootWindow(); |
101 | 101 |
102 static RootWindow* GetForAcceleratedWidget(gfx::AcceleratedWidget widget); | 102 static RootWindow* GetForAcceleratedWidget(gfx::AcceleratedWidget widget); |
103 | 103 |
104 static void set_hide_host_cursor(bool hide) { | |
105 hide_host_cursor_ = hide; | |
106 } | |
107 static bool hide_host_cursor() { | |
108 return hide_host_cursor_; | |
109 } | |
110 | |
111 ui::Compositor* compositor() { return compositor_.get(); } | 104 ui::Compositor* compositor() { return compositor_.get(); } |
112 gfx::NativeCursor last_cursor() const { return last_cursor_; } | 105 gfx::NativeCursor last_cursor() const { return last_cursor_; } |
113 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } | 106 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } |
114 bool cursor_shown() const { return cursor_shown_; } | 107 bool cursor_shown() const { return cursor_shown_; } |
115 | 108 |
116 void set_focus_manager(FocusManager* focus_manager) { | 109 void set_focus_manager(FocusManager* focus_manager) { |
117 focus_manager_ = focus_manager; | 110 focus_manager_ = focus_manager; |
118 } | 111 } |
119 | 112 |
120 // Initializes the root window. | 113 // Initializes the root window. |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 // current mouse location. | 353 // current mouse location. |
361 void SynthesizeMouseMoveEvent(); | 354 void SynthesizeMouseMoveEvent(); |
362 | 355 |
363 // Called by CompositorLock. | 356 // Called by CompositorLock. |
364 void UnlockCompositor(); | 357 void UnlockCompositor(); |
365 | 358 |
366 scoped_ptr<ui::Compositor> compositor_; | 359 scoped_ptr<ui::Compositor> compositor_; |
367 | 360 |
368 scoped_ptr<RootWindowHost> host_; | 361 scoped_ptr<RootWindowHost> host_; |
369 | 362 |
370 // If set before the RootWindow is created, the cursor will be drawn within | |
371 // the Aura root window but hidden outside of it, and it'll remain hidden | |
372 // after the Aura window is closed. | |
373 static bool hide_host_cursor_; | |
374 | |
375 // Used to schedule painting. | 363 // Used to schedule painting. |
376 base::WeakPtrFactory<RootWindow> schedule_paint_factory_; | 364 base::WeakPtrFactory<RootWindow> schedule_paint_factory_; |
377 | 365 |
378 // Use to post mouse move event. | 366 // Use to post mouse move event. |
379 base::WeakPtrFactory<RootWindow> event_factory_; | 367 base::WeakPtrFactory<RootWindow> event_factory_; |
380 | 368 |
381 // ui::EventFlags containing the current state of the mouse buttons. | 369 // ui::EventFlags containing the current state of the mouse buttons. |
382 int mouse_button_flags_; | 370 int mouse_button_flags_; |
383 | 371 |
384 // Touch ids that are currently down. | 372 // Touch ids that are currently down. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 405 |
418 CompositorLock* compositor_lock_; | 406 CompositorLock* compositor_lock_; |
419 bool draw_on_compositor_unlock_; | 407 bool draw_on_compositor_unlock_; |
420 | 408 |
421 DISALLOW_COPY_AND_ASSIGN(RootWindow); | 409 DISALLOW_COPY_AND_ASSIGN(RootWindow); |
422 }; | 410 }; |
423 | 411 |
424 } // namespace aura | 412 } // namespace aura |
425 | 413 |
426 #endif // UI_AURA_ROOT_WINDOW_H_ | 414 #endif // UI_AURA_ROOT_WINDOW_H_ |
OLD | NEW |