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

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

Issue 7976020: Wires up mouse capture code for aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years, 3 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
« no previous file with comments | « no previous file | ui/aura/root_window.cc » ('j') | ui/aura/root_window.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 10
11 namespace aura { 11 namespace aura {
12 namespace internal { 12 namespace internal {
13 13
14 class FocusManager; 14 class FocusManager;
15 15
16 // A Window subclass that handles event targeting for certain types of 16 // A Window subclass that handles event targeting for certain types of
17 // MouseEvent. 17 // MouseEvent.
18 class RootWindow : public Window { 18 class RootWindow : public Window {
19 public: 19 public:
20 RootWindow(); 20 RootWindow();
21 virtual ~RootWindow(); 21 virtual ~RootWindow();
22 22
23 // Handles a mouse event. Returns true if handled. 23 // Handles a mouse event. Returns true if handled.
24 bool HandleMouseEvent(const MouseEvent& event); 24 bool HandleMouseEvent(const MouseEvent& event);
25 25
26 // Handles a key event. Returns true if handled. 26 // Handles a key event. Returns true if handled.
27 bool HandleKeyEvent(const KeyEvent& event); 27 bool HandleKeyEvent(const KeyEvent& event);
28 28
29 // Sets capture to the specified window.
30 void SetCapture(Window* window);
31
32 // If |window| has mouse capture, the current capture window is set to NULL.
33 void ReleaseCapture(Window* window);
34
35 // Returns the window that has mouse capture.
36 Window* capture_window() { return capture_window_; }
37
38 // Invoked when a child window is destroyed. Cleans up any references to the
39 // Window.
40 void WindowDestroying(Window* window);
41
42 // Current handler for mouse events.
43 Window* mouse_pressed_handler() { return mouse_pressed_handler_; }
44
29 // Overridden from Window: 45 // Overridden from Window:
30 virtual FocusManager* GetFocusManager() OVERRIDE; 46 virtual FocusManager* GetFocusManager() OVERRIDE;
31 47
32 private: 48 private:
33 Window* mouse_pressed_handler_; 49 Window* mouse_pressed_handler_;
34 scoped_ptr<FocusManager> focus_manager_; 50 scoped_ptr<FocusManager> focus_manager_;
51 Window* capture_window_;
35 52
36 DISALLOW_COPY_AND_ASSIGN(RootWindow); 53 DISALLOW_COPY_AND_ASSIGN(RootWindow);
37 }; 54 };
38 55
39 } // namespace internal 56 } // namespace internal
40 } // namespace aura 57 } // namespace aura
41 58
42 #endif // UI_AURA_ROOT_WINDOW_H_ 59 #endif // UI_AURA_ROOT_WINDOW_H_
OLDNEW
« no previous file with comments | « no previous file | ui/aura/root_window.cc » ('j') | ui/aura/root_window.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698