OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/views/native_widget_view_manager.h" | 5 #include "mojo/views/native_widget_view_manager.h" |
6 | 6 |
7 #include "mojo/aura/window_tree_host_mojo.h" | 7 #include "mojo/aura/window_tree_host_mojo.h" |
8 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" | 8 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" |
9 #include "mojo/services/public/cpp/view_manager/view.h" | 9 #include "mojo/services/public/cpp/view_manager/view.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 private: | 35 private: |
36 DISALLOW_COPY_AND_ASSIGN(FocusRulesImpl); | 36 DISALLOW_COPY_AND_ASSIGN(FocusRulesImpl); |
37 }; | 37 }; |
38 | 38 |
39 class MinimalInputEventFilter : public ui::internal::InputMethodDelegate, | 39 class MinimalInputEventFilter : public ui::internal::InputMethodDelegate, |
40 public ui::EventHandler { | 40 public ui::EventHandler { |
41 public: | 41 public: |
42 explicit MinimalInputEventFilter(aura::Window* root) | 42 explicit MinimalInputEventFilter(aura::Window* root) |
43 : root_(root), | 43 : root_(root) { |
44 input_method_( | |
45 ui::CreateInputMethod(this, gfx::kNullAcceleratedWidget).Pass()) { | |
46 ui::InitializeInputMethodForTesting(); | 44 ui::InitializeInputMethodForTesting(); |
| 45 input_method_ = ui::CreateInputMethod(this, gfx::kNullAcceleratedWidget); |
47 input_method_->Init(true); | 46 input_method_->Init(true); |
48 root_->AddPreTargetHandler(this); | 47 root_->AddPreTargetHandler(this); |
49 root_->SetProperty(aura::client::kRootWindowInputMethodKey, | 48 root_->SetProperty(aura::client::kRootWindowInputMethodKey, |
50 input_method_.get()); | 49 input_method_.get()); |
51 } | 50 } |
52 | 51 |
53 virtual ~MinimalInputEventFilter() { | 52 virtual ~MinimalInputEventFilter() { |
54 root_->RemovePreTargetHandler(this); | 53 root_->RemovePreTargetHandler(this); |
55 root_->SetProperty(aura::client::kRootWindowInputMethodKey, | 54 root_->SetProperty(aura::client::kRootWindowInputMethodKey, |
56 static_cast<ui::InputMethod*>(NULL)); | 55 static_cast<ui::InputMethod*>(NULL)); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 window_tree_host_->SendEventToProcessor(ui_event.get()); | 166 window_tree_host_->SendEventToProcessor(ui_event.get()); |
168 } | 167 } |
169 | 168 |
170 void NativeWidgetViewManager::OnViewDestroyed(view_manager::View* view) { | 169 void NativeWidgetViewManager::OnViewDestroyed(view_manager::View* view) { |
171 DCHECK_EQ(view, view_); | 170 DCHECK_EQ(view, view_); |
172 view->RemoveObserver(this); | 171 view->RemoveObserver(this); |
173 view_ = NULL; | 172 view_ = NULL; |
174 } | 173 } |
175 | 174 |
176 } // namespace mojo | 175 } // namespace mojo |
OLD | NEW |