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

Side by Side Diff: mandoline/ui/desktop_ui/browser_manager.cc

Issue 1459453003: mandoline: write this after lunch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TracingImpls to mus and mash, fix naming. Created 5 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
« no previous file with comments | « mandoline/ui/desktop_ui/browser_manager.h ('k') | mandoline/ui/omnibox/BUILD.gn » ('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 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 "mandoline/ui/desktop_ui/browser_manager.h" 5 #include "mandoline/ui/desktop_ui/browser_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "components/mus/public/cpp/window.h" 8 #include "components/mus/public/cpp/window.h"
9 #include "components/mus/public/cpp/window_observer.h" 9 #include "components/mus/public/cpp/window_observer.h"
10 #include "mandoline/ui/desktop_ui/browser_window.h" 10 #include "mandoline/ui/desktop_ui/browser_window.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 void BrowserManager::LaunchURL(const mojo::String& url) { 43 void BrowserManager::LaunchURL(const mojo::String& url) {
44 DCHECK(!browsers_.empty()); 44 DCHECK(!browsers_.empty());
45 // TODO(fsamuel): Create a new Browser once we support multiple browser 45 // TODO(fsamuel): Create a new Browser once we support multiple browser
46 // windows. 46 // windows.
47 (*browsers_.begin())->LoadURL(GURL(url)); 47 (*browsers_.begin())->LoadURL(GURL(url));
48 } 48 }
49 49
50 void BrowserManager::Initialize(mojo::ApplicationImpl* app) { 50 void BrowserManager::Initialize(mojo::ApplicationImpl* app) {
51 app_ = app; 51 app_ = app;
52 tracing_.Initialize(app);
52 53
53 mojo::URLRequestPtr request(mojo::URLRequest::New()); 54 mojo::URLRequestPtr request(mojo::URLRequest::New());
54 request->url = "mojo:mus"; 55 request->url = "mojo:mus";
55 app_->ConnectToService(request.Pass(), &host_factory_); 56 app_->ConnectToService(request.Pass(), &host_factory_);
56 57
57 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 58 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
58 // Create a Browser for each valid URL in the command line. 59 // Create a Browser for each valid URL in the command line.
59 for (const auto& arg : command_line->GetArgs()) { 60 for (const auto& arg : command_line->GetArgs()) {
60 GURL url(arg); 61 GURL url(arg);
61 if (url.is_valid()) 62 if (url.is_valid())
(...skipping 10 matching lines...) Expand all
72 connection->AddService<LaunchHandler>(this); 73 connection->AddService<LaunchHandler>(this);
73 return true; 74 return true;
74 } 75 }
75 76
76 void BrowserManager::Create(mojo::ApplicationConnection* connection, 77 void BrowserManager::Create(mojo::ApplicationConnection* connection,
77 mojo::InterfaceRequest<LaunchHandler> request) { 78 mojo::InterfaceRequest<LaunchHandler> request) {
78 launch_handler_bindings_.AddBinding(this, request.Pass()); 79 launch_handler_bindings_.AddBinding(this, request.Pass());
79 } 80 }
80 81
81 } // namespace mandoline 82 } // namespace mandoline
OLDNEW
« no previous file with comments | « mandoline/ui/desktop_ui/browser_manager.h ('k') | mandoline/ui/omnibox/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698