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

Unified Diff: components/web_view/test_runner/test_runner_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: components/web_view/test_runner/test_runner_application_delegate.cc
diff --git a/components/web_view/test_runner/test_runner_application_delegate.cc b/components/web_view/test_runner/test_runner_application_delegate.cc
index 2ec1b08a56efbb348235785fb969577c9004fe85..fc0f698353d73ccd3a84a660635102b05ca0edf3 100644
--- a/components/web_view/test_runner/test_runner_application_delegate.cc
+++ b/components/web_view/test_runner/test_runner_application_delegate.cc
@@ -25,7 +25,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/rect.h"
#include "ui/gfx/geometry/size.h"
#include "url/gurl.h"
@@ -38,7 +38,7 @@
namespace web_view {
TestRunnerApplicationDelegate::TestRunnerApplicationDelegate()
- : app_(nullptr), root_(nullptr), content_(nullptr) {}
+ : shell_(nullptr), root_(nullptr), content_(nullptr) {}
TestRunnerApplicationDelegate::~TestRunnerApplicationDelegate() {
if (root_)
@@ -48,7 +48,7 @@ TestRunnerApplicationDelegate::~TestRunnerApplicationDelegate() {
void TestRunnerApplicationDelegate::LaunchURL(const GURL& test_url) {
if (!web_view_) {
web_view_.reset(new WebView(this));
- web_view_->Init(app_, content_);
+ web_view_->Init(shell_, content_);
}
mojo::URLRequestPtr request(mojo::URLRequest::New());
request->url = test_url.spec();
@@ -63,12 +63,14 @@ void TestRunnerApplicationDelegate::Terminate() {
////////////////////////////////////////////////////////////////////////////////
// mojo::ApplicationDelegate implementation:
-void TestRunnerApplicationDelegate::Initialize(mojo::ApplicationImpl* app) {
+void TestRunnerApplicationDelegate::Initialize(mojo::Shell* shell,
+ const std::string& url,
+ uint32_t id) {
if (!test_runner::BlinkTestPlatformInitialize()) {
NOTREACHED() << "Test environment could not be properly set up for blink.";
}
- app_ = app;
- mus::CreateWindowTreeHost(app_, this, &host_, nullptr);
+ shell_ = shell;
+ mus::CreateWindowTreeHost(shell_, this, &host_, nullptr);
}
bool TestRunnerApplicationDelegate::AcceptConnection(
@@ -115,7 +117,7 @@ void TestRunnerApplicationDelegate::OnEmbed(mus::Window* root) {
void TestRunnerApplicationDelegate::OnConnectionLost(
mus::WindowTreeConnection* connection) {
root_ = nullptr;
- app_->Quit();
+ shell_->Quit();
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698