summaryrefslogtreecommitdiffstats
path: root/content/shell
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-20 08:22:37 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-20 08:22:37 +0000
commitd2494ff2580a40f03b69573dbba9fff1da26875f (patch)
tree150173bc5dee0a4ac5eda1b37afeec18cc29dcee /content/shell
parent24dbdc5d08c4e4f80782e09fd68083a060682a0c (diff)
downloadchromium_src-d2494ff2580a40f03b69573dbba9fff1da26875f.zip
chromium_src-d2494ff2580a40f03b69573dbba9fff1da26875f.tar.gz
chromium_src-d2494ff2580a40f03b69573dbba9fff1da26875f.tar.bz2
[content shell] hook up navigation related WebTestDelegate methods
BUG=111316 R=jam@chromium.org,marja@chromium.org Review URL: https://chromiumcodereview.appspot.com/12296007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r--content/shell/shell.cc15
-rw-r--r--content/shell/shell.h1
-rw-r--r--content/shell/shell_messages.h6
-rw-r--r--content/shell/webkit_test_controller.cc16
-rw-r--r--content/shell/webkit_test_controller.h3
-rw-r--r--content/shell/webkit_test_runner.cc10
6 files changed, 39 insertions, 12 deletions
diff --git a/content/shell/shell.cc b/content/shell/shell.cc
index 0e94316..fe65fc1 100644
--- a/content/shell/shell.cc
+++ b/content/shell/shell.cc
@@ -147,12 +147,15 @@ Shell* Shell::CreateNewWindow(BrowserContext* browser_context,
}
void Shell::LoadURL(const GURL& url) {
- web_contents_->GetController().LoadURL(
- url,
- Referrer(),
- PageTransitionFromInt(PAGE_TRANSITION_TYPED |
- PAGE_TRANSITION_FROM_ADDRESS_BAR),
- std::string());
+ LoadURLForFrame(url, std::string());
+}
+
+void Shell::LoadURLForFrame(const GURL& url, const std::string& frame_name) {
+ NavigationController::LoadURLParams params(url);
+ params.transition_type = PageTransitionFromInt(
+ PAGE_TRANSITION_TYPED | PAGE_TRANSITION_FROM_ADDRESS_BAR);
+ params.frame_name = frame_name;
+ web_contents_->GetController().LoadURLWithParams(params);
web_contents_->Focus();
}
diff --git a/content/shell/shell.h b/content/shell/shell.h
index 2a3ccd1..6514d26 100644
--- a/content/shell/shell.h
+++ b/content/shell/shell.h
@@ -54,6 +54,7 @@ class Shell : public WebContentsDelegate,
virtual ~Shell();
void LoadURL(const GURL& url);
+ void LoadURLForFrame(const GURL& url, const std::string& frame_name);
void GoBackOrForward(int offset);
void Reload();
void Stop();
diff --git a/content/shell/shell_messages.h b/content/shell/shell_messages.h
index e84f6e7..5b0b083 100644
--- a/content/shell/shell_messages.h
+++ b/content/shell/shell_messages.h
@@ -72,6 +72,12 @@ IPC_MESSAGE_ROUTED1(ShellViewHostMsg_PrintMessage,
std::string /* message */)
IPC_MESSAGE_ROUTED0(ShellViewHostMsg_ShowDevTools)
IPC_MESSAGE_ROUTED0(ShellViewHostMsg_CloseDevTools)
+IPC_MESSAGE_ROUTED1(ShellViewHostMsg_GoToOffset,
+ int /* offset */)
+IPC_MESSAGE_ROUTED0(ShellViewHostMsg_Reload)
+IPC_MESSAGE_ROUTED2(ShellViewHostMsg_LoadURLForFrame,
+ GURL /* url */,
+ std::string /* frame_name */)
IPC_MESSAGE_ROUTED2(ShellViewHostMsg_NotImplemented,
std::string /* object_name */,
diff --git a/content/shell/webkit_test_controller.cc b/content/shell/webkit_test_controller.cc
index 097c674..e761b56 100644
--- a/content/shell/webkit_test_controller.cc
+++ b/content/shell/webkit_test_controller.cc
@@ -277,6 +277,9 @@ bool WebKitTestController::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ShellViewHostMsg_TestFinished, OnTestFinished)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_ShowDevTools, OnShowDevTools)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_CloseDevTools, OnCloseDevTools)
+ IPC_MESSAGE_HANDLER(ShellViewHostMsg_GoToOffset, OnGoToOffset)
+ IPC_MESSAGE_HANDLER(ShellViewHostMsg_Reload, OnReload)
+ IPC_MESSAGE_HANDLER(ShellViewHostMsg_LoadURLForFrame, OnLoadURLForFrame)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_NotImplemented, OnNotImplemented)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -437,6 +440,19 @@ void WebKitTestController::OnCloseDevTools() {
main_window_->CloseDevTools();
}
+void WebKitTestController::OnGoToOffset(int offset) {
+ main_window_->GoBackOrForward(offset);
+}
+
+void WebKitTestController::OnReload() {
+ main_window_->Reload();
+}
+
+void WebKitTestController::OnLoadURLForFrame(const GURL& url,
+ const std::string& frame_name) {
+ main_window_->LoadURLForFrame(url, frame_name);
+}
+
void WebKitTestController::OnNotImplemented(
const std::string& object_name,
const std::string& property_name) {
diff --git a/content/shell/webkit_test_controller.h b/content/shell/webkit_test_controller.h
index d5fe862..b544e7d 100644
--- a/content/shell/webkit_test_controller.h
+++ b/content/shell/webkit_test_controller.h
@@ -123,6 +123,9 @@ class WebKitTestController : public base::NonThreadSafe,
void OnTestFinished(bool did_timeout);
void OnShowDevTools();
void OnCloseDevTools();
+ void OnGoToOffset(int offset);
+ void OnReload();
+ void OnLoadURLForFrame(const GURL& url, const std::string& frame_name);
void OnNotImplemented(const std::string& object_name,
const std::string& method_name);
diff --git a/content/shell/webkit_test_runner.cc b/content/shell/webkit_test_runner.cc
index 3f988e8..54023ba 100644
--- a/content/shell/webkit_test_runner.cc
+++ b/content/shell/webkit_test_runner.cc
@@ -445,19 +445,17 @@ int WebKitTestRunner::windowCount() {
}
void WebKitTestRunner::goToOffset(int offset) {
- Send(new ShellViewHostMsg_NotImplemented(
- routing_id(), "WebKitTestRunner", "goToOffset"));
+ Send(new ShellViewHostMsg_GoToOffset(routing_id(), offset));
}
void WebKitTestRunner::reload() {
- Send(new ShellViewHostMsg_NotImplemented(
- routing_id(), "WebKitTestRunner", "reload"));
+ Send(new ShellViewHostMsg_Reload(routing_id()));
}
void WebKitTestRunner::loadURLForFrame(const WebURL& url,
const std::string& frame_name) {
- Send(new ShellViewHostMsg_NotImplemented(
- routing_id(), "WebKitTestRunner", "loadURLForFrame"));
+ Send(new ShellViewHostMsg_LoadURLForFrame(
+ routing_id(), url, frame_name));
}
bool WebKitTestRunner::allowExternalPages() {