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/widget.h" | 5 #include "views/widget/widget.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "ui/gfx/compositor/compositor.h" | 9 #include "ui/gfx/compositor/compositor.h" |
10 #include "views/focus/view_storage.h" | 10 #include "views/focus/view_storage.h" |
| 11 #include "views/ime/input_method.h" |
11 #include "views/widget/default_theme_provider.h" | 12 #include "views/widget/default_theme_provider.h" |
12 #include "views/widget/root_view.h" | 13 #include "views/widget/root_view.h" |
13 #include "views/widget/native_widget.h" | 14 #include "views/widget/native_widget.h" |
14 | 15 |
15 namespace views { | 16 namespace views { |
16 | 17 |
17 //////////////////////////////////////////////////////////////////////////////// | 18 //////////////////////////////////////////////////////////////////////////////// |
18 // Widget, CreateParams: | 19 // Widget, CreateParams: |
19 | 20 |
20 Widget::CreateParams::CreateParams() | 21 Widget::CreateParams::CreateParams() |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 213 } |
213 | 214 |
214 FocusManager* Widget::GetFocusManager() { | 215 FocusManager* Widget::GetFocusManager() { |
215 Widget* toplevel_widget = GetTopLevelWidget(); | 216 Widget* toplevel_widget = GetTopLevelWidget(); |
216 if (toplevel_widget && toplevel_widget != this) | 217 if (toplevel_widget && toplevel_widget != this) |
217 return toplevel_widget->focus_manager_.get(); | 218 return toplevel_widget->focus_manager_.get(); |
218 | 219 |
219 return focus_manager_.get(); | 220 return focus_manager_.get(); |
220 } | 221 } |
221 | 222 |
| 223 InputMethod* Widget::GetInputMethod() { |
| 224 Widget* toplevel_widget = GetTopLevelWidget(); |
| 225 return toplevel_widget ? |
| 226 toplevel_widget->native_widget()->GetInputMethodNative() : NULL; |
| 227 } |
| 228 |
222 bool Widget::ContainsNativeView(gfx::NativeView native_view) { | 229 bool Widget::ContainsNativeView(gfx::NativeView native_view) { |
223 if (native_widget_->ContainsNativeView(native_view)) | 230 if (native_widget_->ContainsNativeView(native_view)) |
224 return true; | 231 return true; |
225 | 232 |
226 // A views::NativeViewHost may contain the given native view, without it being | 233 // A views::NativeViewHost may contain the given native view, without it being |
227 // an ancestor of hwnd(), so traverse the views::View hierarchy looking for | 234 // an ancestor of hwnd(), so traverse the views::View hierarchy looking for |
228 // such views. | 235 // such views. |
229 return GetRootView()->ContainsNativeView(native_view); | 236 return GetRootView()->ContainsNativeView(native_view); |
230 } | 237 } |
231 | 238 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 compositor_ = ui::Compositor::Create(widget); | 432 compositor_ = ui::Compositor::Create(widget); |
426 | 433 |
427 return compositor_.get() != NULL; | 434 return compositor_.get() != NULL; |
428 } | 435 } |
429 | 436 |
430 bool Widget::ShouldReleaseCaptureOnMouseReleased() const { | 437 bool Widget::ShouldReleaseCaptureOnMouseReleased() const { |
431 return true; | 438 return true; |
432 } | 439 } |
433 | 440 |
434 } // namespace views | 441 } // namespace views |
OLD | NEW |