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

Side by Side Diff: ui/views/mus/window_manager_connection.cc

Issue 2301353003: Changes ownership of WindowTreeClient (Closed)
Patch Set: fix navigation Created 4 years, 3 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
« no previous file with comments | « ui/views/mus/window_manager_connection.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 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 "ui/views/mus/window_manager_connection.h" 5 #include "ui/views/mus/window_manager_connection.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 ui::OSExchangeDataProviderFactory::SetFactory(this); 133 ui::OSExchangeDataProviderFactory::SetFactory(this);
134 134
135 ViewsDelegate::GetInstance()->set_native_widget_factory(base::Bind( 135 ViewsDelegate::GetInstance()->set_native_widget_factory(base::Bind(
136 &WindowManagerConnection::CreateNativeWidgetMus, 136 &WindowManagerConnection::CreateNativeWidgetMus,
137 base::Unretained(this), 137 base::Unretained(this),
138 std::map<std::string, std::vector<uint8_t>>())); 138 std::map<std::string, std::vector<uint8_t>>()));
139 } 139 }
140 140
141 void WindowManagerConnection::OnEmbed(ui::Window* root) {} 141 void WindowManagerConnection::OnEmbed(ui::Window* root) {}
142 142
143 void WindowManagerConnection::OnDidDestroyClient(ui::WindowTreeClient* client) { 143 void WindowManagerConnection::OnLostConnection(ui::WindowTreeClient* client) {
144 if (client_.get() == client) { 144 DCHECK_EQ(client, client_.get());
145 client_.release(); 145 client_.reset();
146 } else { 146 }
147 DCHECK(!client_); 147
148 } 148 void WindowManagerConnection::OnEmbedRootDestroyed(ui::Window* root) {
149 // Not called for WindowManagerConnection as WindowTreeClient isn't created by
150 // way of an Embed().
151 NOTREACHED();
149 } 152 }
150 153
151 void WindowManagerConnection::OnPointerEventObserved( 154 void WindowManagerConnection::OnPointerEventObserved(
152 const ui::PointerEvent& event, 155 const ui::PointerEvent& event,
153 ui::Window* target) { 156 ui::Window* target) {
154 pointer_watcher_event_router_->OnPointerEventObserved(event, target); 157 pointer_watcher_event_router_->OnPointerEventObserved(event, target);
155 } 158 }
156 159
157 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { 160 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() {
158 if (client_) 161 if (client_)
159 NativeWidgetMus::NotifyFrameChanged(client_.get()); 162 NativeWidgetMus::NotifyFrameChanged(client_.get());
160 } 163 }
161 164
162 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { 165 gfx::Point WindowManagerConnection::GetCursorScreenPoint() {
163 return client_->GetCursorScreenPoint(); 166 return client_->GetCursorScreenPoint();
164 } 167 }
165 168
166 std::unique_ptr<OSExchangeData::Provider> 169 std::unique_ptr<OSExchangeData::Provider>
167 WindowManagerConnection::BuildProvider() { 170 WindowManagerConnection::BuildProvider() {
168 return base::MakeUnique<OSExchangeDataProviderMus>(); 171 return base::MakeUnique<OSExchangeDataProviderMus>();
169 } 172 }
170 173
171 } // namespace views 174 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/window_manager_connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698