| 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 "services/view_manager/connection_manager.h" | 5 #include "services/view_manager/connection_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "mojo/converters/geometry/geometry_type_converters.h" | 9 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 10 #include "mojo/converters/input_events/input_events_type_converters.h" | 10 #include "mojo/converters/input_events/input_events_type_converters.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 void ConnectionManager::SetWindowManagerClientConnection( | 236 void ConnectionManager::SetWindowManagerClientConnection( |
| 237 scoped_ptr<ClientConnection> connection) { | 237 scoped_ptr<ClientConnection> connection) { |
| 238 CHECK(!window_manager_client_connection_); | 238 CHECK(!window_manager_client_connection_); |
| 239 window_manager_client_connection_ = connection.release(); | 239 window_manager_client_connection_ = connection.release(); |
| 240 AddConnection(window_manager_client_connection_); | 240 AddConnection(window_manager_client_connection_); |
| 241 window_manager_client_connection_->service()->Init( | 241 window_manager_client_connection_->service()->Init( |
| 242 window_manager_client_connection_->client(), nullptr, nullptr, nullptr); | 242 window_manager_client_connection_->client(), nullptr, nullptr, nullptr); |
| 243 } | 243 } |
| 244 | 244 |
| 245 mojo::ViewManagerClient* |
| 246 ConnectionManager::GetWindowManagerViewManagerClient() { |
| 247 CHECK(window_manager_client_connection_); |
| 248 return window_manager_client_connection_->client(); |
| 249 } |
| 250 |
| 245 bool ConnectionManager::CloneAndAnimate(const ViewId& view_id) { | 251 bool ConnectionManager::CloneAndAnimate(const ViewId& view_id) { |
| 246 ServerView* view = GetView(view_id); | 252 ServerView* view = GetView(view_id); |
| 247 if (!view || !view->IsDrawn(root_.get()) || view == root_.get()) | 253 if (!view || !view->IsDrawn(root_.get()) || view == root_.get()) |
| 248 return false; | 254 return false; |
| 249 if (!animation_timer_.IsRunning()) { | 255 if (!animation_timer_.IsRunning()) { |
| 250 animation_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(100), | 256 animation_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(100), |
| 251 this, &ConnectionManager::DoAnimation); | 257 this, &ConnectionManager::DoAnimation); |
| 252 } | 258 } |
| 253 ServerView* clone = CloneView(view, this); | 259 ServerView* clone = CloneView(view, this); |
| 254 CloneViewTree(view, clone, this); | 260 CloneViewTree(view, clone, this); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 void ConnectionManager::SetViewportSize(mojo::SizePtr size) { | 485 void ConnectionManager::SetViewportSize(mojo::SizePtr size) { |
| 480 gfx::Size new_size = size.To<gfx::Size>(); | 486 gfx::Size new_size = size.To<gfx::Size>(); |
| 481 display_manager_->SetViewportSize(new_size); | 487 display_manager_->SetViewportSize(new_size); |
| 482 } | 488 } |
| 483 | 489 |
| 484 void ConnectionManager::CloneAndAnimate(mojo::Id transport_view_id) { | 490 void ConnectionManager::CloneAndAnimate(mojo::Id transport_view_id) { |
| 485 CloneAndAnimate(ViewIdFromTransportId(transport_view_id)); | 491 CloneAndAnimate(ViewIdFromTransportId(transport_view_id)); |
| 486 } | 492 } |
| 487 | 493 |
| 488 } // namespace view_manager | 494 } // namespace view_manager |
| OLD | NEW |