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

Side by Side Diff: components/web_view/web_view_application_delegate.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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 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 "components/web_view/web_view_application_delegate.h" 5 #include "components/web_view/web_view_application_delegate.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "components/web_view/web_view_impl.h" 9 #include "components/web_view/web_view_impl.h"
10 #include "mojo/shell/public/cpp/application_connection.h" 10 #include "mojo/shell/public/cpp/application_connection.h"
11 11
12 namespace web_view { 12 namespace web_view {
13 13
14 WebViewApplicationDelegate::WebViewApplicationDelegate() : app_(nullptr) {} 14 WebViewApplicationDelegate::WebViewApplicationDelegate() : shell_(nullptr) {}
15 WebViewApplicationDelegate::~WebViewApplicationDelegate() {} 15 WebViewApplicationDelegate::~WebViewApplicationDelegate() {}
16 16
17 void WebViewApplicationDelegate::Initialize(mojo::ApplicationImpl* app) { 17 void WebViewApplicationDelegate::Initialize(mojo::Shell* shell,
18 app_ = app; 18 const std::string& url,
19 tracing_.Initialize(app); 19 uint32_t id) {
20 shell_ = shell;
21 tracing_.Initialize(shell, url);
20 } 22 }
21 23
22 bool WebViewApplicationDelegate::AcceptConnection( 24 bool WebViewApplicationDelegate::AcceptConnection(
23 mojo::ApplicationConnection* connection) { 25 mojo::ApplicationConnection* connection) {
24 connection->AddService<mojom::WebViewFactory>(this); 26 connection->AddService<mojom::WebViewFactory>(this);
25 return true; 27 return true;
26 } 28 }
27 29
28 void WebViewApplicationDelegate::CreateWebView( 30 void WebViewApplicationDelegate::CreateWebView(
29 mojom::WebViewClientPtr client, 31 mojom::WebViewClientPtr client,
30 mojo::InterfaceRequest<mojom::WebView> web_view) { 32 mojo::InterfaceRequest<mojom::WebView> web_view) {
31 new WebViewImpl(app_, std::move(client), std::move(web_view)); 33 new WebViewImpl(shell_, std::move(client), std::move(web_view));
32 } 34 }
33 35
34 void WebViewApplicationDelegate::Create( 36 void WebViewApplicationDelegate::Create(
35 mojo::ApplicationConnection* connection, 37 mojo::ApplicationConnection* connection,
36 mojo::InterfaceRequest<mojom::WebViewFactory> request) { 38 mojo::InterfaceRequest<mojom::WebViewFactory> request) {
37 factory_bindings_.AddBinding(this, std::move(request)); 39 factory_bindings_.AddBinding(this, std::move(request));
38 } 40 }
39 41
40 } // namespace web_view 42 } // namespace web_view
OLDNEW
« no previous file with comments | « components/web_view/web_view_application_delegate.h ('k') | components/web_view/web_view_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698