OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mandoline/ui/aura/native_widget_view_manager.h" | 5 #include "mandoline/ui/aura/native_widget_view_manager.h" |
6 | 6 |
7 #include "mandoline/ui/aura/input_method_mandoline.h" | 7 #include "mandoline/ui/aura/input_method_mandoline.h" |
8 #include "mandoline/ui/aura/window_tree_host_mojo.h" | 8 #include "mandoline/ui/aura/window_tree_host_mojo.h" |
9 #include "mojo/converters/geometry/geometry_type_converters.h" | 9 #include "mojo/converters/geometry/geometry_type_converters.h" |
10 #include "mojo/converters/input_events/input_events_type_converters.h" | 10 #include "mojo/converters/input_events/input_events_type_converters.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 const views::Widget::InitParams& in_params) { | 65 const views::Widget::InitParams& in_params) { |
66 views::Widget::InitParams params(in_params); | 66 views::Widget::InitParams params(in_params); |
67 params.parent = window_tree_host_->window(); | 67 params.parent = window_tree_host_->window(); |
68 NativeWidgetAura::InitNativeWidget(params); | 68 NativeWidgetAura::InitNativeWidget(params); |
69 } | 69 } |
70 | 70 |
71 void NativeWidgetViewManager::OnWindowVisibilityChanged(aura::Window* window, | 71 void NativeWidgetViewManager::OnWindowVisibilityChanged(aura::Window* window, |
72 bool visible) { | 72 bool visible) { |
73 view_->SetVisible(visible); | 73 view_->SetVisible(visible); |
74 // NOTE: We could also update aura::Window's visibility when the View's | 74 // NOTE: We could also update aura::Window's visibility when the View's |
75 // visibilty changes, but this code isn't going to be around for very long so | 75 // visibility changes, but this code isn't going to be around for very long so |
76 // I'm not bothering. | 76 // I'm not bothering. |
77 } | 77 } |
78 | 78 |
79 void NativeWidgetViewManager::OnViewDestroyed(mus::View* view) { | 79 void NativeWidgetViewManager::OnViewDestroyed(mus::View* view) { |
80 DCHECK_EQ(view, view_); | 80 DCHECK_EQ(view, view_); |
81 view->RemoveObserver(this); | 81 view->RemoveObserver(this); |
82 view_ = NULL; | 82 view_ = NULL; |
83 // TODO(sky): WindowTreeHostMojo assumes the View outlives it. | 83 // TODO(sky): WindowTreeHostMojo assumes the View outlives it. |
84 // NativeWidgetViewManager needs to deal, likely by deleting this. | 84 // NativeWidgetViewManager needs to deal, likely by deleting this. |
85 } | 85 } |
(...skipping 22 matching lines...) Expand all Loading... |
108 | 108 |
109 if (ui_event->IsKeyEvent()) { | 109 if (ui_event->IsKeyEvent()) { |
110 window_tree_host_->GetInputMethod()->DispatchKeyEvent( | 110 window_tree_host_->GetInputMethod()->DispatchKeyEvent( |
111 static_cast<ui::KeyEvent*>(ui_event.get())); | 111 static_cast<ui::KeyEvent*>(ui_event.get())); |
112 } else { | 112 } else { |
113 window_tree_host_->SendEventToProcessor(ui_event.get()); | 113 window_tree_host_->SendEventToProcessor(ui_event.get()); |
114 } | 114 } |
115 } | 115 } |
116 | 116 |
117 } // namespace mandoline | 117 } // namespace mandoline |
OLD | NEW |