| 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 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
| 10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
| 11 #include "ui/aura/client/focus_client.h" | 11 #include "ui/aura/client/focus_client.h" |
| 12 #include "ui/aura/client/window_tree_client.h" | 12 #include "ui/aura/client/window_tree_client.h" |
| 13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
| 14 #include "ui/aura/window_observer.h" | 14 #include "ui/aura/window_observer.h" |
| 15 #include "ui/aura/window_property.h" | 15 #include "ui/aura/window_property.h" |
| 16 #include "ui/aura/window_tree_host.h" | 16 #include "ui/aura/window_tree_host.h" |
| 17 #include "ui/base/hit_test.h" | 17 #include "ui/base/hit_test.h" |
| 18 #include "ui/base/ime/input_method.h" | 18 #include "ui/base/ime/input_method.h" |
| 19 #include "ui/base/ui_base_switches_util.h" | |
| 20 #include "ui/compositor/layer.h" | 19 #include "ui/compositor/layer.h" |
| 21 #include "ui/gfx/canvas.h" | 20 #include "ui/gfx/canvas.h" |
| 22 #include "ui/gfx/display.h" | 21 #include "ui/gfx/display.h" |
| 23 #include "ui/gfx/geometry/point_conversions.h" | 22 #include "ui/gfx/geometry/point_conversions.h" |
| 24 #include "ui/gfx/geometry/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
| 25 #include "ui/gfx/geometry/size_conversions.h" | 24 #include "ui/gfx/geometry/size_conversions.h" |
| 26 #include "ui/gfx/screen.h" | 25 #include "ui/gfx/screen.h" |
| 27 #include "ui/native_theme/native_theme.h" | 26 #include "ui/native_theme/native_theme.h" |
| 28 #include "ui/views/corewm/tooltip.h" | 27 #include "ui/views/corewm/tooltip.h" |
| 29 #include "ui/views/corewm/tooltip_controller.h" | 28 #include "ui/views/corewm/tooltip_controller.h" |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 | 621 |
| 623 content_window_->ReleaseCapture(); | 622 content_window_->ReleaseCapture(); |
| 624 } | 623 } |
| 625 | 624 |
| 626 bool DesktopNativeWidgetAura::HasCapture() const { | 625 bool DesktopNativeWidgetAura::HasCapture() const { |
| 627 return content_window_ && content_window_->HasCapture() && | 626 return content_window_ && content_window_->HasCapture() && |
| 628 desktop_window_tree_host_->HasCapture(); | 627 desktop_window_tree_host_->HasCapture(); |
| 629 } | 628 } |
| 630 | 629 |
| 631 InputMethod* DesktopNativeWidgetAura::CreateInputMethod() { | 630 InputMethod* DesktopNativeWidgetAura::CreateInputMethod() { |
| 632 if (switches::IsTextInputFocusManagerEnabled()) | |
| 633 return new NullInputMethod(); | |
| 634 | |
| 635 return new InputMethodBridge(this, GetHostInputMethod(), false); | 631 return new InputMethodBridge(this, GetHostInputMethod(), false); |
| 636 } | 632 } |
| 637 | 633 |
| 638 internal::InputMethodDelegate* | 634 internal::InputMethodDelegate* |
| 639 DesktopNativeWidgetAura::GetInputMethodDelegate() { | 635 DesktopNativeWidgetAura::GetInputMethodDelegate() { |
| 640 return this; | 636 return this; |
| 641 } | 637 } |
| 642 | 638 |
| 643 ui::InputMethod* DesktopNativeWidgetAura::GetHostInputMethod() { | 639 ui::InputMethod* DesktopNativeWidgetAura::GetHostInputMethod() { |
| 644 return host()->GetInputMethod(); | 640 return host()->GetInputMethod(); |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 if (cursor_reference_count_ == 0) { | 1229 if (cursor_reference_count_ == 0) { |
| 1234 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1230 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
| 1235 // for cleaning up |cursor_manager_|. | 1231 // for cleaning up |cursor_manager_|. |
| 1236 delete cursor_manager_; | 1232 delete cursor_manager_; |
| 1237 native_cursor_manager_ = NULL; | 1233 native_cursor_manager_ = NULL; |
| 1238 cursor_manager_ = NULL; | 1234 cursor_manager_ = NULL; |
| 1239 } | 1235 } |
| 1240 } | 1236 } |
| 1241 | 1237 |
| 1242 } // namespace views | 1238 } // namespace views |
| OLD | NEW |