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

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

Issue 418983002: Nukes view_manager namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resolve merge 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/views/native_widget_view_manager.h ('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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 aura::Window* root_; 81 aura::Window* root_;
82 scoped_ptr<ui::InputMethod> input_method_; 82 scoped_ptr<ui::InputMethod> input_method_;
83 83
84 DISALLOW_COPY_AND_ASSIGN(MinimalInputEventFilter); 84 DISALLOW_COPY_AND_ASSIGN(MinimalInputEventFilter);
85 }; 85 };
86 86
87 } // namespace 87 } // namespace
88 88
89 NativeWidgetViewManager::NativeWidgetViewManager( 89 NativeWidgetViewManager::NativeWidgetViewManager(
90 views::internal::NativeWidgetDelegate* delegate, view_manager::Node* node) 90 views::internal::NativeWidgetDelegate* delegate, Node* node)
91 : NativeWidgetAura(delegate), 91 : NativeWidgetAura(delegate),
92 node_(node), 92 node_(node),
93 view_(node_->active_view()) { 93 view_(node_->active_view()) {
94 node_->AddObserver(this); 94 node_->AddObserver(this);
95 if (view_) 95 if (view_)
96 view_->AddObserver(this); 96 view_->AddObserver(this);
97 window_tree_host_.reset(new WindowTreeHostMojo(node_, this)); 97 window_tree_host_.reset(new WindowTreeHostMojo(node_, this));
98 window_tree_host_->InitHost(); 98 window_tree_host_->InitHost();
99 99
100 ime_filter_.reset( 100 ime_filter_.reset(
(...skipping 27 matching lines...) Expand all
128 capture_client_.reset( 128 capture_client_.reset(
129 new wm::ScopedCaptureClient(window_tree_host_->window())); 129 new wm::ScopedCaptureClient(window_tree_host_->window()));
130 } 130 }
131 131
132 void NativeWidgetViewManager::CompositorContentsChanged( 132 void NativeWidgetViewManager::CompositorContentsChanged(
133 const SkBitmap& bitmap) { 133 const SkBitmap& bitmap) {
134 if (view_) 134 if (view_)
135 view_->SetContents(bitmap); 135 view_->SetContents(bitmap);
136 } 136 }
137 137
138 void NativeWidgetViewManager::OnNodeDestroyed(view_manager::Node* node) { 138 void NativeWidgetViewManager::OnNodeDestroyed(Node* node) {
139 DCHECK_EQ(node, node_); 139 DCHECK_EQ(node, node_);
140 node->RemoveObserver(this); 140 node->RemoveObserver(this);
141 node_ = NULL; 141 node_ = NULL;
142 window_tree_host_.reset(); 142 window_tree_host_.reset();
143 } 143 }
144 144
145 void NativeWidgetViewManager::OnNodeBoundsChanged(view_manager::Node* node, 145 void NativeWidgetViewManager::OnNodeBoundsChanged(Node* node,
146 const gfx::Rect& old_bounds, 146 const gfx::Rect& old_bounds,
147 const gfx::Rect& new_bounds) { 147 const gfx::Rect& new_bounds) {
148 GetWidget()->SetBounds(gfx::Rect(node->bounds().size())); 148 GetWidget()->SetBounds(gfx::Rect(node->bounds().size()));
149 } 149 }
150 150
151 void NativeWidgetViewManager::OnNodeActiveViewChanged( 151 void NativeWidgetViewManager::OnNodeActiveViewChanged(
152 view_manager::Node* node, 152 Node* node,
153 view_manager::View* old_view, 153 View* old_view,
154 view_manager::View* new_view) { 154 View* new_view) {
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* 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) 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* 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/views/native_widget_view_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698