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

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

Issue 405653003: mojo: Make InterfacePtr<> testable in if() statements without .get(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move to is_bound() 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 | « mojo/system/local_data_pipe.cc ('k') | 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 if (old_view) 155 if (old_view)
156 old_view->RemoveObserver(this); 156 old_view->RemoveObserver(this);
157 if (new_view) 157 if (new_view)
158 new_view->AddObserver(this); 158 new_view->AddObserver(this);
159 view_ = new_view; 159 view_ = new_view;
160 } 160 }
161 161
162 void NativeWidgetViewManager::OnViewInputEvent(view_manager::View* view, 162 void NativeWidgetViewManager::OnViewInputEvent(view_manager::View* view,
163 const EventPtr& event) { 163 const EventPtr& event) {
164 scoped_ptr<ui::Event> ui_event(event.To<scoped_ptr<ui::Event> >()); 164 scoped_ptr<ui::Event> ui_event(event.To<scoped_ptr<ui::Event> >());
165 if (ui_event.get()) 165 if (ui_event)
166 window_tree_host_->SendEventToProcessor(ui_event.get()); 166 window_tree_host_->SendEventToProcessor(ui_event.get());
167 } 167 }
168 168
169 void NativeWidgetViewManager::OnViewDestroyed(view_manager::View* view) { 169 void NativeWidgetViewManager::OnViewDestroyed(view_manager::View* view) {
170 DCHECK_EQ(view, view_); 170 DCHECK_EQ(view, view_);
171 view->RemoveObserver(this); 171 view->RemoveObserver(this);
172 view_ = NULL; 172 view_ = NULL;
173 } 173 }
174 174
175 } // namespace mojo 175 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/local_data_pipe.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698