OLD | NEW |
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 #include "views/widget/window_manager.h" | 5 #include "views/widget/window_manager.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "views/events/event.h" | 8 #include "views/events/event.h" |
9 #include "views/widget/widget.h" | 9 #include "views/widget/widget.h" |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 if (widget && mouse_capture_ != widget) | 41 if (widget && mouse_capture_ != widget) |
42 return false; | 42 return false; |
43 mouse_capture_ = NULL; | 43 mouse_capture_ = NULL; |
44 return true; | 44 return true; |
45 } | 45 } |
46 | 46 |
47 virtual bool HasMouseCapture(const views::Widget* widget) const OVERRIDE { | 47 virtual bool HasMouseCapture(const views::Widget* widget) const OVERRIDE { |
48 return mouse_capture_ == widget; | 48 return mouse_capture_ == widget; |
49 } | 49 } |
50 | 50 |
| 51 virtual bool HandleKeyEvent(views::Widget* widget, |
| 52 const views::KeyEvent& event) OVERRIDE { |
| 53 return false; |
| 54 } |
| 55 |
51 virtual bool HandleMouseEvent(views::Widget* widget, | 56 virtual bool HandleMouseEvent(views::Widget* widget, |
52 const views::MouseEvent& event) OVERRIDE { | 57 const views::MouseEvent& event) OVERRIDE { |
53 if (mouse_capture_) { | 58 if (mouse_capture_) { |
54 views::MouseEvent translated(event, widget->GetRootView(), | 59 views::MouseEvent translated(event, widget->GetRootView(), |
55 mouse_capture_->GetRootView()); | 60 mouse_capture_->GetRootView()); |
56 mouse_capture_->OnMouseEvent(translated); | 61 mouse_capture_->OnMouseEvent(translated); |
57 return true; | 62 return true; |
58 } | 63 } |
59 return false; | 64 return false; |
60 } | 65 } |
61 | 66 |
| 67 void Register(views::Widget* widget) OVERRIDE {} |
| 68 |
62 private: | 69 private: |
63 views::Widget* mouse_capture_; | 70 views::Widget* mouse_capture_; |
64 }; | 71 }; |
65 | 72 |
66 } // namespace | 73 } // namespace |
67 | 74 |
68 namespace views { | 75 namespace views { |
69 | 76 |
70 WindowManager::WindowManager() { | 77 WindowManager::WindowManager() { |
71 } | 78 } |
72 | 79 |
73 WindowManager::~WindowManager() { | 80 WindowManager::~WindowManager() { |
74 } | 81 } |
75 | 82 |
76 // static | 83 // static |
77 void WindowManager::Install(WindowManager* wm) { | 84 void WindowManager::Install(WindowManager* wm) { |
78 window_manager = wm; | 85 window_manager = wm; |
79 } | 86 } |
80 | 87 |
81 // static | 88 // static |
82 WindowManager* WindowManager::Get() { | 89 WindowManager* WindowManager::Get() { |
83 if (!window_manager) | 90 if (!window_manager) |
84 window_manager = new NullWindowManager(); | 91 window_manager = new NullWindowManager(); |
85 return window_manager; | 92 return window_manager; |
86 } | 93 } |
87 | 94 |
88 } // namespace views | 95 } // namespace views |
OLD | NEW |