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

Unified Diff: sky/viewer/document_view.cc

Issue 741453002: Make sure that Content Handled application can be connected multiple times. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: sky/viewer/document_view.cc
diff --git a/sky/viewer/document_view.cc b/sky/viewer/document_view.cc
index 499829902106d4db3980bd489355785522bf5cb6..b0058e16aafba4a134389ecde3ee2068ec44d6d7 100644
--- a/sky/viewer/document_view.cc
+++ b/sky/viewer/document_view.cc
@@ -67,19 +67,23 @@ mojo::Target WebNavigationPolicyToNavigationTarget(
static int s_next_debugger_id = 1;
DocumentView::DocumentView(
+ const base::Closure& destruction_callback,
+ mojo::ServiceProviderPtr provider,
mojo::URLResponsePtr response,
- mojo::ShellPtr shell,
+ mojo::Shell* shell,
scoped_refptr<base::MessageLoopProxy> compositor_thread)
- : response_(response.Pass()),
- shell_(shell.Pass()),
+ : destruction_callback_(destruction_callback),
+ response_(response.Pass()),
+ shell_(shell),
web_view_(NULL),
root_(NULL),
- view_manager_client_factory_(shell_.get(), this),
+ view_manager_client_factory_(shell_, this),
inspector_service_factory_(this),
compositor_thread_(compositor_thread),
debugger_id_(s_next_debugger_id++),
weak_factory_(this) {
- shell_.set_client(this);
+ exported_services_.AddService(&view_manager_client_factory_);
+ mojo::WeakBindToPipe(&exported_services_, provider.PassMessagePipe());
}
DocumentView::~DocumentView() {
@@ -87,21 +91,13 @@ DocumentView::~DocumentView() {
web_view_->close();
if (root_)
root_->RemoveObserver(this);
+ destruction_callback_.Run();
}
base::WeakPtr<DocumentView> DocumentView::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
-void DocumentView::AcceptConnection(const mojo::String& requestor_url,
- mojo::ServiceProviderPtr provider) {
- exported_services_.AddService(&view_manager_client_factory_);
- mojo::WeakBindToPipe(&exported_services_, provider.PassMessagePipe());
-}
-
-void DocumentView::Initialize(mojo::Array<mojo::String> args) {
-}
-
void DocumentView::OnEmbed(
mojo::ViewManager* view_manager,
mojo::View* root,
@@ -211,7 +207,7 @@ mojo::NavigatorHost* DocumentView::NavigatorHost() {
}
mojo::Shell* DocumentView::Shell() {
- return shell_.get();
+ return shell_;
}
void DocumentView::OnViewBoundsChanged(mojo::View* view,
« mojo/application_manager/background_shell_application_loader.cc ('K') | « sky/viewer/document_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698