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

Unified Diff: mandoline/ui/phone_ui/phone_browser_application_delegate.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
Index: mandoline/ui/phone_ui/phone_browser_application_delegate.cc
diff --git a/mandoline/ui/phone_ui/phone_browser_application_delegate.cc b/mandoline/ui/phone_ui/phone_browser_application_delegate.cc
index de133ab90884fa52443d3230166454888161e8ae..666cafbf13e8b6898b0b7b315955b82ba61374ad 100644
--- a/mandoline/ui/phone_ui/phone_browser_application_delegate.cc
+++ b/mandoline/ui/phone_ui/phone_browser_application_delegate.cc
@@ -11,7 +11,7 @@
#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/services/network/public/interfaces/url_loader.mojom.h"
#include "mojo/shell/public/cpp/application_connection.h"
-#include "mojo/shell/public/cpp/application_impl.h"
+#include "mojo/shell/public/cpp/shell.h"
#include "ui/gfx/geometry/size.h"
#include "url/gurl.h"
@@ -21,7 +21,7 @@ namespace mandoline {
// PhoneBrowserApplicationDelegate, public:
PhoneBrowserApplicationDelegate::PhoneBrowserApplicationDelegate()
- : app_(nullptr),
+ : shell_(nullptr),
root_(nullptr),
content_(nullptr),
web_view_(this),
@@ -36,8 +36,10 @@ PhoneBrowserApplicationDelegate::~PhoneBrowserApplicationDelegate() {
////////////////////////////////////////////////////////////////////////////////
// PhoneBrowserApplicationDelegate, mojo::ApplicationDelegate implementation:
-void PhoneBrowserApplicationDelegate::Initialize(mojo::ApplicationImpl* app) {
- app_ = app;
+void PhoneBrowserApplicationDelegate::Initialize(mojo::Shell* shell,
+ const std::string& url,
+ uint32_t id) {
+ shell_ = shell;
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
for (const auto& arg : command_line->GetArgs()) {
@@ -47,7 +49,7 @@ void PhoneBrowserApplicationDelegate::Initialize(mojo::ApplicationImpl* app) {
break;
}
}
- mus::CreateWindowTreeHost(app_, this, &host_, nullptr, nullptr);
+ mus::CreateWindowTreeHost(shell_, this, &host_, nullptr, nullptr);
}
bool PhoneBrowserApplicationDelegate::AcceptConnection(
@@ -78,7 +80,7 @@ void PhoneBrowserApplicationDelegate::OnEmbed(mus::Window* root) {
root->AddObserver(this);
host_->SetSize(mojo::Size::From(gfx::Size(320, 640)));
- web_view_.Init(app_, content_);
+ web_view_.Init(shell_, content_);
LaunchURL(default_url_);
}
« no previous file with comments | « mandoline/ui/phone_ui/phone_browser_application_delegate.h ('k') | mash/browser_driver/browser_driver_application_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698