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/debug/trace_event.h" | 8 #include "base/debug/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" |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 | 925 |
926 ui::NativeTheme* DesktopNativeWidgetAura::GetNativeTheme() const { | 926 ui::NativeTheme* DesktopNativeWidgetAura::GetNativeTheme() const { |
927 return DesktopWindowTreeHost::GetNativeTheme(content_window_); | 927 return DesktopWindowTreeHost::GetNativeTheme(content_window_); |
928 } | 928 } |
929 | 929 |
930 void DesktopNativeWidgetAura::OnRootViewLayout() const { | 930 void DesktopNativeWidgetAura::OnRootViewLayout() const { |
931 if (content_window_) | 931 if (content_window_) |
932 desktop_window_tree_host_->OnRootViewLayout(); | 932 desktop_window_tree_host_->OnRootViewLayout(); |
933 } | 933 } |
934 | 934 |
| 935 void DesktopNativeWidgetAura::RepostNativeEvent(gfx::NativeEvent native_event) { |
| 936 OnEvent(native_event); |
| 937 } |
| 938 |
935 //////////////////////////////////////////////////////////////////////////////// | 939 //////////////////////////////////////////////////////////////////////////////// |
936 // DesktopNativeWidgetAura, aura::WindowDelegate implementation: | 940 // DesktopNativeWidgetAura, aura::WindowDelegate implementation: |
937 | 941 |
938 gfx::Size DesktopNativeWidgetAura::GetMinimumSize() const { | 942 gfx::Size DesktopNativeWidgetAura::GetMinimumSize() const { |
939 return native_widget_delegate_->GetMinimumSize(); | 943 return native_widget_delegate_->GetMinimumSize(); |
940 } | 944 } |
941 | 945 |
942 gfx::Size DesktopNativeWidgetAura::GetMaximumSize() const { | 946 gfx::Size DesktopNativeWidgetAura::GetMaximumSize() const { |
943 return native_widget_delegate_->GetMaximumSize(); | 947 return native_widget_delegate_->GetMaximumSize(); |
944 } | 948 } |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 | 1175 |
1172 void DesktopNativeWidgetAura::OnHostMoved(const aura::WindowTreeHost* host, | 1176 void DesktopNativeWidgetAura::OnHostMoved(const aura::WindowTreeHost* host, |
1173 const gfx::Point& new_origin) { | 1177 const gfx::Point& new_origin) { |
1174 TRACE_EVENT1("views", "DesktopNativeWidgetAura::OnHostMoved", | 1178 TRACE_EVENT1("views", "DesktopNativeWidgetAura::OnHostMoved", |
1175 "new_origin", new_origin.ToString()); | 1179 "new_origin", new_origin.ToString()); |
1176 | 1180 |
1177 native_widget_delegate_->OnNativeWidgetMove(); | 1181 native_widget_delegate_->OnNativeWidgetMove(); |
1178 } | 1182 } |
1179 | 1183 |
1180 //////////////////////////////////////////////////////////////////////////////// | 1184 //////////////////////////////////////////////////////////////////////////////// |
1181 // DesktopNativeWidgetAura, NativeWidget implementation: | 1185 // DesktopNativeWidgetAura, private: |
1182 | |
1183 ui::EventHandler* DesktopNativeWidgetAura::GetEventHandler() { | |
1184 return this; | |
1185 } | |
1186 | 1186 |
1187 void DesktopNativeWidgetAura::InstallInputMethodEventFilter() { | 1187 void DesktopNativeWidgetAura::InstallInputMethodEventFilter() { |
1188 DCHECK(!input_method_event_filter_.get()); | 1188 DCHECK(!input_method_event_filter_.get()); |
1189 | 1189 |
1190 input_method_event_filter_.reset(new wm::InputMethodEventFilter( | 1190 input_method_event_filter_.reset(new wm::InputMethodEventFilter( |
1191 host_->GetAcceleratedWidget())); | 1191 host_->GetAcceleratedWidget())); |
1192 input_method_event_filter_->SetInputMethodPropertyInRootWindow( | 1192 input_method_event_filter_->SetInputMethodPropertyInRootWindow( |
1193 host_->window()); | 1193 host_->window()); |
1194 root_window_event_filter_->AddHandler(input_method_event_filter_.get()); | 1194 root_window_event_filter_->AddHandler(input_method_event_filter_.get()); |
1195 } | 1195 } |
(...skipping 12 matching lines...) Expand all Loading... |
1208 if (cursor_reference_count_ == 0) { | 1208 if (cursor_reference_count_ == 0) { |
1209 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1209 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
1210 // for cleaning up |cursor_manager_|. | 1210 // for cleaning up |cursor_manager_|. |
1211 delete cursor_manager_; | 1211 delete cursor_manager_; |
1212 native_cursor_manager_ = NULL; | 1212 native_cursor_manager_ = NULL; |
1213 cursor_manager_ = NULL; | 1213 cursor_manager_ = NULL; |
1214 } | 1214 } |
1215 } | 1215 } |
1216 | 1216 |
1217 } // namespace views | 1217 } // namespace views |
OLD | NEW |