Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: ui/aura/root_window.h

Issue 11035050: Enable CursorManager::LockCursor to lock cursor visibility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ui::Compositor* compositor() { return compositor_.get(); } 104 ui::Compositor* compositor() { return compositor_.get(); }
105 gfx::NativeCursor last_cursor() const { return last_cursor_; } 105 gfx::NativeCursor last_cursor() const { return last_cursor_; }
106 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } 106 Window* mouse_pressed_handler() { return mouse_pressed_handler_; }
107 bool cursor_shown() const { return cursor_shown_; }
108 107
109 void set_focus_manager(FocusManager* focus_manager) { 108 void set_focus_manager(FocusManager* focus_manager) {
110 focus_manager_ = focus_manager; 109 focus_manager_ = focus_manager;
111 } 110 }
112 111
113 // Initializes the root window. 112 // Initializes the root window.
114 void Init(); 113 void Init();
115 114
116 // Shows the root window host. 115 // Shows the root window host.
117 void ShowRootWindow(); 116 void ShowRootWindow();
(...skipping 15 matching lines...) Expand all
133 132
134 // Returns where the RootWindow is on screen. 133 // Returns where the RootWindow is on screen.
135 gfx::Point GetHostOrigin() const; 134 gfx::Point GetHostOrigin() const;
136 135
137 // Sets the currently-displayed cursor. If the cursor was previously hidden 136 // Sets the currently-displayed cursor. If the cursor was previously hidden
138 // via ShowCursor(false), it will remain hidden until ShowCursor(true) is 137 // via ShowCursor(false), it will remain hidden until ShowCursor(true) is
139 // called, at which point the cursor that was last set via SetCursor() will be 138 // called, at which point the cursor that was last set via SetCursor() will be
140 // used. 139 // used.
141 void SetCursor(gfx::NativeCursor cursor); 140 void SetCursor(gfx::NativeCursor cursor);
142 141
143 // Shows or hides the cursor. 142 // Invoked when the cursor's visibility has changed.
144 void ShowCursor(bool show); 143 void OnCursorVisibilityChanged(bool visible);
145 144
146 // Moves the cursor to the specified location relative to the root window. 145 // Moves the cursor to the specified location relative to the root window.
147 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; 146 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
148 147
149 // Clips the cursor movement to the root_window. 148 // Clips the cursor movement to the root_window.
150 bool ConfineCursorToWindow(); 149 bool ConfineCursorToWindow();
151 150
152 // Draws the necessary set of windows. 151 // Draws the necessary set of windows.
153 void Draw(); 152 void Draw();
154 153
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 371
373 // ui::EventFlags containing the current state of the mouse buttons. 372 // ui::EventFlags containing the current state of the mouse buttons.
374 int mouse_button_flags_; 373 int mouse_button_flags_;
375 374
376 // Touch ids that are currently down. 375 // Touch ids that are currently down.
377 uint32 touch_ids_down_; 376 uint32 touch_ids_down_;
378 377
379 // Last cursor set. Used for testing. 378 // Last cursor set. Used for testing.
380 gfx::NativeCursor last_cursor_; 379 gfx::NativeCursor last_cursor_;
381 380
382 // Is the cursor currently shown? Used for testing.
383 bool cursor_shown_;
384
385 ObserverList<RootWindowObserver> observers_; 381 ObserverList<RootWindowObserver> observers_;
386 382
387 Window* mouse_pressed_handler_; 383 Window* mouse_pressed_handler_;
388 Window* mouse_moved_handler_; 384 Window* mouse_moved_handler_;
389 Window* mouse_event_dispatch_target_; 385 Window* mouse_event_dispatch_target_;
390 Window* event_dispatch_target_; 386 Window* event_dispatch_target_;
391 FocusManager* focus_manager_; 387 FocusManager* focus_manager_;
392 388
393 // The gesture_recognizer_ for this. 389 // The gesture_recognizer_ for this.
394 scoped_ptr<ui::GestureRecognizer> gesture_recognizer_; 390 scoped_ptr<ui::GestureRecognizer> gesture_recognizer_;
(...skipping 14 matching lines...) Expand all
409 405
410 CompositorLock* compositor_lock_; 406 CompositorLock* compositor_lock_;
411 bool draw_on_compositor_unlock_; 407 bool draw_on_compositor_unlock_;
412 408
413 DISALLOW_COPY_AND_ASSIGN(RootWindow); 409 DISALLOW_COPY_AND_ASSIGN(RootWindow);
414 }; 410 };
415 411
416 } // namespace aura 412 } // namespace aura
417 413
418 #endif // UI_AURA_ROOT_WINDOW_H_ 414 #endif // UI_AURA_ROOT_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698