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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 // current mouse location. | 356 // current mouse location. |
364 void SynthesizeMouseMoveEvent(); | 357 void SynthesizeMouseMoveEvent(); |
365 | 358 |
366 // Called by CompositorLock. | 359 // Called by CompositorLock. |
367 void UnlockCompositor(); | 360 void UnlockCompositor(); |
368 | 361 |
369 scoped_ptr<ui::Compositor> compositor_; | 362 scoped_ptr<ui::Compositor> compositor_; |
370 | 363 |
371 scoped_ptr<RootWindowHost> host_; | 364 scoped_ptr<RootWindowHost> host_; |
372 | 365 |
373 // If set before the RootWindow is created, the cursor will be drawn within | |
374 // the Aura root window but hidden outside of it, and it'll remain hidden | |
375 // after the Aura window is closed. | |
376 static bool hide_host_cursor_; | |
377 | |
378 // Used to schedule painting. | 366 // Used to schedule painting. |
379 base::WeakPtrFactory<RootWindow> schedule_paint_factory_; | 367 base::WeakPtrFactory<RootWindow> schedule_paint_factory_; |
380 | 368 |
381 // Use to post mouse move event. | 369 // Use to post mouse move event. |
382 base::WeakPtrFactory<RootWindow> event_factory_; | 370 base::WeakPtrFactory<RootWindow> event_factory_; |
383 | 371 |
384 // ui::EventFlags containing the current state of the mouse buttons. | 372 // ui::EventFlags containing the current state of the mouse buttons. |
385 int mouse_button_flags_; | 373 int mouse_button_flags_; |
386 | 374 |
387 // Touch ids that are currently down. | 375 // Touch ids that are currently down. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 408 |
421 CompositorLock* compositor_lock_; | 409 CompositorLock* compositor_lock_; |
422 bool draw_on_compositor_unlock_; | 410 bool draw_on_compositor_unlock_; |
423 | 411 |
424 DISALLOW_COPY_AND_ASSIGN(RootWindow); | 412 DISALLOW_COPY_AND_ASSIGN(RootWindow); |
425 }; | 413 }; |
426 | 414 |
427 } // namespace aura | 415 } // namespace aura |
428 | 416 |
429 #endif // UI_AURA_ROOT_WINDOW_H_ | 417 #endif // UI_AURA_ROOT_WINDOW_H_ |
OLD | NEW |