OLD | NEW |
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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "components/mus/public/cpp/window.h" | 10 #include "components/mus/public/cpp/window.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 DCHECK_GT(browsers_.count(browser), 0u); | 39 DCHECK_GT(browsers_.count(browser), 0u); |
40 browsers_.erase(browser); | 40 browsers_.erase(browser); |
41 if (browsers_.empty()) | 41 if (browsers_.empty()) |
42 app_->Quit(); | 42 app_->Quit(); |
43 } | 43 } |
44 | 44 |
45 void BrowserManager::LaunchURL(const mojo::String& url) { | 45 void BrowserManager::LaunchURL(const mojo::String& url) { |
46 DCHECK(!browsers_.empty()); | 46 DCHECK(!browsers_.empty()); |
47 // TODO(fsamuel): Create a new Browser once we support multiple browser | 47 // TODO(fsamuel): Create a new Browser once we support multiple browser |
48 // windows. | 48 // windows. |
49 (*browsers_.begin())->LoadURL(GURL(url)); | 49 (*browsers_.begin())->LoadURL(GURL(url.get())); |
50 } | 50 } |
51 | 51 |
52 void BrowserManager::Initialize(mojo::ApplicationImpl* app) { | 52 void BrowserManager::Initialize(mojo::ApplicationImpl* app) { |
53 app_ = app; | 53 app_ = app; |
54 tracing_.Initialize(app); | 54 tracing_.Initialize(app); |
55 | 55 |
56 app_->ConnectToService("mojo:mus", &host_factory_); | 56 app_->ConnectToService("mojo:mus", &host_factory_); |
57 | 57 |
58 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 58 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
59 // Create a Browser for each valid URL in the command line. | 59 // Create a Browser for each valid URL in the command line. |
(...skipping 13 matching lines...) Expand all Loading... |
73 connection->AddService<LaunchHandler>(this); | 73 connection->AddService<LaunchHandler>(this); |
74 return true; | 74 return true; |
75 } | 75 } |
76 | 76 |
77 void BrowserManager::Create(mojo::ApplicationConnection* connection, | 77 void BrowserManager::Create(mojo::ApplicationConnection* connection, |
78 mojo::InterfaceRequest<LaunchHandler> request) { | 78 mojo::InterfaceRequest<LaunchHandler> request) { |
79 launch_handler_bindings_.AddBinding(this, std::move(request)); | 79 launch_handler_bindings_.AddBinding(this, std::move(request)); |
80 } | 80 } |
81 | 81 |
82 } // namespace mandoline | 82 } // namespace mandoline |
OLD | NEW |