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

Side by Side Diff: mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc

Issue 591633002: Replace most uses of ViewManagerInitService with client lib ViewManager::Embed() to offer the same … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 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
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/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
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
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
OLDNEW
« no previous file with comments | « mojo/services/public/cpp/view_manager/BUILD.gn ('k') | mojo/services/public/cpp/view_manager/lib/view_manager_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698