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

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

Issue 1568073002: Reduce string copies in GURL creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « mandoline/services/updater/updater_impl.cc ('k') | mandoline/ui/desktop_ui/browser_window.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 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
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
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
OLDNEW
« no previous file with comments | « mandoline/services/updater/updater_impl.cc ('k') | mandoline/ui/desktop_ui/browser_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698