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

Side by Side Diff: sky/viewer/services/inspector_impl.cc

Issue 710043004: Make it possible to have multiple InspectorBackends (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Split out ServerImpl, somehow breaks JS connections... 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 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 "sky/viewer/services/inspector_impl.h" 5 #include "sky/viewer/services/inspector_impl.h"
6 6
7 #include "base/bind.h"
7 #include "sky/engine/public/web/WebDocument.h" 8 #include "sky/engine/public/web/WebDocument.h"
8 #include "sky/engine/public/web/WebElement.h" 9 #include "sky/engine/public/web/WebElement.h"
9 #include "sky/engine/public/web/WebFrame.h" 10 #include "sky/engine/public/web/WebFrame.h"
10 #include "sky/engine/public/web/WebView.h" 11 #include "sky/engine/public/web/WebView.h"
11 #include "sky/viewer/document_view.h" 12 #include "sky/viewer/document_view.h"
12 13
13 namespace sky { 14 namespace sky {
14 15
15 InspectorServiceImpl::InspectorServiceImpl(DocumentView* view) 16 InspectorServiceImpl::InspectorServiceImpl(DocumentView* view)
16 : view_(view->GetWeakPtr()) { 17 : view_(view->GetWeakPtr()) {
17 } 18 }
18 19
19 InspectorServiceImpl::~InspectorServiceImpl() { 20 InspectorServiceImpl::~InspectorServiceImpl() {
20 } 21 }
21 22
23 void Ignored() {}
Aaron Boodman 2014/11/11 16:12:50 We should put a templated version of this in bindi
24
22 void InspectorServiceImpl::Inject() { 25 void InspectorServiceImpl::Inject() {
23 if (!view_) 26 if (!view_)
24 return; 27 return;
28
29 mojo::ServiceProviderPtr inpector_service_provider;
30 view_->shell()->ConnectToApplication("mojo:sky_inspector_server",
31 GetProxy(&inpector_service_provider));
32 InspectorServerPtr inspector;
33 ConnectToService(inpector_service_provider.get(), &inspector);
34 inspector->Listen(9898, base::Bind(&Ignored));
35 inspector.WaitForIncomingMethodCall();
25 view_->web_view()->injectModule("/sky/framework/inspector/inspector.sky"); 36 view_->web_view()->injectModule("/sky/framework/inspector/inspector.sky");
26 } 37 }
27 38
28 } // namespace sky 39 } // namespace sky
OLDNEW
« sky/services/inspector/server.cc ('K') | « sky/viewer/services/inspector_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698