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

Unified Diff: mandoline/ui/desktop_ui/browser_manager.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mandoline/ui/desktop_ui/browser_manager.h ('k') | mandoline/ui/desktop_ui/browser_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mandoline/ui/desktop_ui/browser_manager.cc
diff --git a/mandoline/ui/desktop_ui/browser_manager.cc b/mandoline/ui/desktop_ui/browser_manager.cc
index d7bf35423a40338687d030d24e1010cdc82100dc..b3a51234be84668883643e825ead873efe4723cd 100644
--- a/mandoline/ui/desktop_ui/browser_manager.cc
+++ b/mandoline/ui/desktop_ui/browser_manager.cc
@@ -10,6 +10,7 @@
#include "components/mus/public/cpp/window.h"
#include "components/mus/public/cpp/window_observer.h"
#include "mandoline/ui/desktop_ui/browser_window.h"
+#include "mojo/shell/public/cpp/shell.h"
namespace mandoline {
@@ -20,7 +21,7 @@ const char kGoogleURL[] = "http://www.google.com";
} // namespace
BrowserManager::BrowserManager()
- : app_(nullptr), startup_ticks_(base::TimeTicks::Now()) {}
+ : shell_(nullptr), startup_ticks_(base::TimeTicks::Now()) {}
BrowserManager::~BrowserManager() {
while (!browsers_.empty())
@@ -29,7 +30,7 @@ BrowserManager::~BrowserManager() {
}
BrowserWindow* BrowserManager::CreateBrowser(const GURL& default_url) {
- BrowserWindow* browser = new BrowserWindow(app_, host_factory_.get(), this);
+ BrowserWindow* browser = new BrowserWindow(shell_, host_factory_.get(), this);
browsers_.insert(browser);
browser->LoadURL(default_url);
return browser;
@@ -39,7 +40,7 @@ void BrowserManager::BrowserWindowClosed(BrowserWindow* browser) {
DCHECK_GT(browsers_.count(browser), 0u);
browsers_.erase(browser);
if (browsers_.empty())
- app_->Quit();
+ shell_->Quit();
}
void BrowserManager::LaunchURL(const mojo::String& url) {
@@ -49,11 +50,12 @@ void BrowserManager::LaunchURL(const mojo::String& url) {
(*browsers_.begin())->LoadURL(GURL(url.get()));
}
-void BrowserManager::Initialize(mojo::ApplicationImpl* app) {
- app_ = app;
- tracing_.Initialize(app);
+void BrowserManager::Initialize(mojo::Shell* shell, const std::string& url,
+ uint32_t id) {
+ shell_ = shell;
+ tracing_.Initialize(shell, url);
- app_->ConnectToService("mojo:mus", &host_factory_);
+ shell_->ConnectToService("mojo:mus", &host_factory_);
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
// Create a Browser for each valid URL in the command line.
« no previous file with comments | « mandoline/ui/desktop_ui/browser_manager.h ('k') | mandoline/ui/desktop_ui/browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698