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

Side by Side Diff: sky/tools/debugger/debugger.cc

Issue 875183002: Make it possible to pass a default url to sky_debugger (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « sky/tools/debugger/debugger.h ('k') | sky/tools/debugger/prompt/prompt.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/tools/debugger/debugger.h" 5 #include "sky/tools/debugger/debugger.h"
6 6
7 #include "services/window_manager/basic_focus_rules.h" 7 #include "services/window_manager/basic_focus_rules.h"
8 8
9 namespace sky { 9 namespace sky {
10 namespace debugger { 10 namespace debugger {
(...skipping 10 matching lines...) Expand all
21 SkyDebugger::~SkyDebugger() { 21 SkyDebugger::~SkyDebugger() {
22 } 22 }
23 23
24 base::WeakPtr<SkyDebugger> SkyDebugger::GetWeakPtr() { 24 base::WeakPtr<SkyDebugger> SkyDebugger::GetWeakPtr() {
25 return weak_factory_.GetWeakPtr(); 25 return weak_factory_.GetWeakPtr();
26 } 26 }
27 27
28 void SkyDebugger::Initialize(mojo::ApplicationImpl* app) { 28 void SkyDebugger::Initialize(mojo::ApplicationImpl* app) {
29 window_manager_app_->Initialize(app); 29 window_manager_app_->Initialize(app);
30 app->ConnectToApplication("mojo:sky_debugger_prompt"); 30 app->ConnectToApplication("mojo:sky_debugger_prompt");
31
32 // Format: --args-for="app_url default_url"
33 if (app->args().size() > 1)
34 default_url_ = app->args()[1];
31 } 35 }
32 36
33 bool SkyDebugger::ConfigureIncomingConnection( 37 bool SkyDebugger::ConfigureIncomingConnection(
34 mojo::ApplicationConnection* connection) { 38 mojo::ApplicationConnection* connection) {
35 window_manager_app_->ConfigureIncomingConnection(connection); 39 window_manager_app_->ConfigureIncomingConnection(connection);
36 connection->AddService(this); 40 connection->AddService(this);
41
42 if (!default_url_.empty())
43 NavigateToURL(default_url_); // Schedule a navigation in the new embedding.
37 return true; 44 return true;
38 } 45 }
39 46
40 bool SkyDebugger::ConfigureOutgoingConnection( 47 bool SkyDebugger::ConfigureOutgoingConnection(
41 mojo::ApplicationConnection* connection) { 48 mojo::ApplicationConnection* connection) {
42 window_manager_app_->ConfigureOutgoingConnection(connection); 49 window_manager_app_->ConfigureOutgoingConnection(connection);
43 connection->AddService(this); 50 connection->AddService(this);
44 return true; 51 return true;
45 } 52 }
46 53
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 124 }
118 125
119 void SkyDebugger::InjectInspector() { 126 void SkyDebugger::InjectInspector() {
120 InspectorServicePtr inspector_service; 127 InspectorServicePtr inspector_service;
121 mojo::ConnectToService(viewer_services_.get(), &inspector_service); 128 mojo::ConnectToService(viewer_services_.get(), &inspector_service);
122 inspector_service->Inject(); 129 inspector_service->Inject();
123 } 130 }
124 131
125 } // namespace debugger 132 } // namespace debugger
126 } // namespace sky 133 } // namespace sky
OLDNEW
« no previous file with comments | « sky/tools/debugger/debugger.h ('k') | sky/tools/debugger/prompt/prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698