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 "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" | 5 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "mojo/public/cpp/application/application_impl.h" |
11 #include "mojo/public/cpp/application/connect.h" | 12 #include "mojo/public/cpp/application/connect.h" |
12 #include "mojo/public/cpp/application/service_provider_impl.h" | 13 #include "mojo/public/cpp/application/service_provider_impl.h" |
13 #include "mojo/public/interfaces/application/service_provider.mojom.h" | 14 #include "mojo/public/interfaces/application/service_provider.mojom.h" |
14 #include "mojo/public/interfaces/application/shell.mojom.h" | 15 #include "mojo/public/interfaces/application/shell.mojom.h" |
15 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" | 16 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" |
16 #include "mojo/services/public/cpp/view_manager/util.h" | 17 #include "mojo/services/public/cpp/view_manager/util.h" |
17 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" | 18 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" |
18 #include "mojo/services/public/cpp/view_manager/view_observer.h" | 19 #include "mojo/services/public/cpp/view_manager/view_observer.h" |
19 #include "mojo/services/public/cpp/view_manager/window_manager_delegate.h" | 20 #include "mojo/services/public/cpp/view_manager/window_manager_delegate.h" |
20 #include "third_party/skia/include/core/SkBitmap.h" | 21 #include "third_party/skia/include/core/SkBitmap.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 FOR_EACH_OBSERVER(ViewObserver, | 350 FOR_EACH_OBSERVER(ViewObserver, |
350 *ViewPrivate(view).observers(), | 351 *ViewPrivate(view).observers(), |
351 OnViewInputEvent(view, event)); | 352 OnViewInputEvent(view, event)); |
352 } | 353 } |
353 ack_callback.Run(); | 354 ack_callback.Run(); |
354 } | 355 } |
355 | 356 |
356 void ViewManagerClientImpl::Embed( | 357 void ViewManagerClientImpl::Embed( |
357 const String& url, | 358 const String& url, |
358 InterfaceRequest<ServiceProvider> service_provider) { | 359 InterfaceRequest<ServiceProvider> service_provider) { |
359 window_manager_delegate_->Embed(url, service_provider.Pass()); | 360 if (window_manager_delegate_) |
| 361 window_manager_delegate_->Embed(url, service_provider.Pass()); |
360 } | 362 } |
361 | 363 |
362 void ViewManagerClientImpl::DispatchOnViewInputEvent(EventPtr event) { | 364 void ViewManagerClientImpl::DispatchOnViewInputEvent(EventPtr event) { |
363 if (window_manager_delegate_) | 365 if (window_manager_delegate_) |
364 window_manager_delegate_->DispatchEvent(event.Pass()); | 366 window_manager_delegate_->DispatchEvent(event.Pass()); |
365 } | 367 } |
366 | 368 |
367 //////////////////////////////////////////////////////////////////////////////// | 369 //////////////////////////////////////////////////////////////////////////////// |
368 // ViewManagerClientImpl, WindowManagerClient implementation: | 370 // ViewManagerClientImpl, WindowManagerClient implementation: |
369 | 371 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 base::Unretained(this)); | 417 base::Unretained(this)); |
416 } | 418 } |
417 | 419 |
418 base::Callback<void(ErrorCode)> | 420 base::Callback<void(ErrorCode)> |
419 ViewManagerClientImpl::ActionCompletedCallbackWithErrorCode() { | 421 ViewManagerClientImpl::ActionCompletedCallbackWithErrorCode() { |
420 return base::Bind(&ViewManagerClientImpl::OnActionCompletedWithErrorCode, | 422 return base::Bind(&ViewManagerClientImpl::OnActionCompletedWithErrorCode, |
421 base::Unretained(this)); | 423 base::Unretained(this)); |
422 } | 424 } |
423 | 425 |
424 } // namespace mojo | 426 } // namespace mojo |
OLD | NEW |