Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: mojo/views/native_widget_view_manager.cc

Issue 400713002: mojo: Fix running mojo_demo_launcher with chromeos=1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698