| 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 "view_manager/public/cpp/lib/view_manager_client_impl.h" | 5 #include "view_manager/public/cpp/lib/view_manager_client_impl.h" |
| 6 | 6 |
| 7 #include "mojo/public/cpp/application/application_impl.h" | 7 #include "mojo/public/cpp/application/application_impl.h" |
| 8 #include "mojo/public/cpp/application/connect.h" | 8 #include "mojo/public/cpp/application/connect.h" |
| 9 #include "mojo/public/cpp/application/service_provider_impl.h" | 9 #include "mojo/public/cpp/application/service_provider_impl.h" |
| 10 #include "mojo/public/interfaces/application/service_provider.mojom.h" | 10 #include "mojo/public/interfaces/application/service_provider.mojom.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 DCHECK(service); | 235 DCHECK(service); |
| 236 service_ = service.Pass(); | 236 service_ = service.Pass(); |
| 237 } | 237 } |
| 238 //////////////////////////////////////////////////////////////////////////////// | 238 //////////////////////////////////////////////////////////////////////////////// |
| 239 // ViewManagerClientImpl, ViewManager implementation: | 239 // ViewManagerClientImpl, ViewManager implementation: |
| 240 | 240 |
| 241 Id ViewManagerClientImpl::CreateViewOnServer() { | 241 Id ViewManagerClientImpl::CreateViewOnServer() { |
| 242 DCHECK(service_); | 242 DCHECK(service_); |
| 243 const Id view_id = MakeTransportId(connection_id_, ++next_id_); | 243 const Id view_id = MakeTransportId(connection_id_, ++next_id_); |
| 244 service_->CreateView(view_id, [this](ErrorCode code) { | 244 service_->CreateView(view_id, [this](ErrorCode code) { |
| 245 OnActionCompleted(code == ERROR_CODE_NONE); | 245 OnActionCompleted(code == ErrorCode::NONE); |
| 246 }); | 246 }); |
| 247 return view_id; | 247 return view_id; |
| 248 } | 248 } |
| 249 | 249 |
| 250 const std::string& ViewManagerClientImpl::GetEmbedderURL() const { | 250 const std::string& ViewManagerClientImpl::GetEmbedderURL() const { |
| 251 return creator_url_; | 251 return creator_url_; |
| 252 } | 252 } |
| 253 | 253 |
| 254 View* ViewManagerClientImpl::GetRoot() { | 254 View* ViewManagerClientImpl::GetRoot() { |
| 255 return root_; | 255 return root_; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 void ViewManagerClientImpl::OnActionCompleted(bool success) { | 497 void ViewManagerClientImpl::OnActionCompleted(bool success) { |
| 498 if (!change_acked_callback_.is_null()) | 498 if (!change_acked_callback_.is_null()) |
| 499 change_acked_callback_.Run(); | 499 change_acked_callback_.Run(); |
| 500 } | 500 } |
| 501 | 501 |
| 502 Callback<void(bool)> ViewManagerClientImpl::ActionCompletedCallback() { | 502 Callback<void(bool)> ViewManagerClientImpl::ActionCompletedCallback() { |
| 503 return [this](bool success) { OnActionCompleted(success); }; | 503 return [this](bool success) { OnActionCompleted(success); }; |
| 504 } | 504 } |
| 505 | 505 |
| 506 } // namespace mojo | 506 } // namespace mojo |
| OLD | NEW |