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

Unified Diff: components/html_viewer/html_document_application_delegate.cc

Issue 1218323002: Hook up test runner to new layout_test_html_viewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 5 years, 5 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 | « components/html_viewer/html_document_application_delegate.h ('k') | components/html_viewer/html_viewer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/html_document_application_delegate.cc
diff --git a/components/html_viewer/html_document_application_delegate.cc b/components/html_viewer/html_document_application_delegate.cc
index afb82505ffb22df7f32269dbdbbd9c5cdc3089e4..8638640167463b9cce2f6cacbe8d720b6d9a74d0 100644
--- a/components/html_viewer/html_document_application_delegate.cc
+++ b/components/html_viewer/html_document_application_delegate.cc
@@ -7,7 +7,6 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "components/html_viewer/global_state.h"
-#include "components/html_viewer/html_document.h"
#include "components/html_viewer/html_document_oopif.h"
#include "components/html_viewer/html_viewer_switches.h"
#include "mojo/application/public/cpp/application_connection.h"
@@ -22,6 +21,10 @@ bool EnableOOPIFs() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kOOPIF);
}
+HTMLDocument* CreateHTMLDocument(HTMLDocument::CreateParams* params) {
+ return new HTMLDocument(params);
+}
+
} // namespace
// ServiceConnectorQueue records all incoming service requests and processes
@@ -75,7 +78,8 @@ HTMLDocumentApplicationDelegate::HTMLDocumentApplicationDelegate(
parent_app_refcount_(parent_app_refcount.Pass()),
url_(response->url),
initial_response_(response.Pass()),
- global_state_(global_state) {
+ global_state_(global_state),
+ html_document_creation_callback_(base::Bind(CreateHTMLDocument)) {
}
HTMLDocumentApplicationDelegate::~HTMLDocumentApplicationDelegate() {
@@ -93,6 +97,11 @@ HTMLDocumentApplicationDelegate::~HTMLDocumentApplicationDelegate() {
DCHECK(documents2_.empty());
}
+void HTMLDocumentApplicationDelegate::SetHTMLDocumentCreationCallback(
+ const HTMLDocumentCreationCallback& callback) {
+ html_document_creation_callback_ = callback;
+}
+
// Callback from the quit closure. We key off this rather than
// ApplicationDelegate::Quit() as we don't want to shut down the messageloop
// when we quit (the messageloop is shared among multiple
@@ -172,7 +181,7 @@ void HTMLDocumentApplicationDelegate::OnResponseReceived(
&app_, connection, response.Pass(), global_state_,
base::Bind(&HTMLDocumentApplicationDelegate::OnHTMLDocumentDeleted,
base::Unretained(this)));
- HTMLDocument* document = new HTMLDocument(&params);
+ HTMLDocument* document = html_document_creation_callback_.Run(&params);
documents_.insert(document);
}
« no previous file with comments | « components/html_viewer/html_document_application_delegate.h ('k') | components/html_viewer/html_viewer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698