summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 20:18:07 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 20:18:07 +0000
commita455d381543e773418e645b3192c8731430a646e (patch)
treef52ea9e8a6a2db06957637b8698d7c5007b2e4a5 /chrome/renderer
parent2eb312b025971ee1529b3a6c67d715055cb77906 (diff)
downloadchromium_src-a455d381543e773418e645b3192c8731430a646e.zip
chromium_src-a455d381543e773418e645b3192c8731430a646e.tar.gz
chromium_src-a455d381543e773418e645b3192c8731430a646e.tar.bz2
Try #2 of "make JavaScript alerts reflect the URL of the frame they came from,
not the enclosing frame." The diffrence between this one and the previous version of this patch is the addition of test_webview_delegate. BUG=1686837 Review URL: http://codereview.chromium.org/39163 Review URL: http://codereview.chromium.org/40175 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11026 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/render_view.cc16
-rw-r--r--chrome/renderer/render_view.h9
2 files changed, 15 insertions, 10 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index ae76377..6251636 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -1660,42 +1660,46 @@ class MessageBoxView {
};
#endif
-void RenderView::RunJavaScriptAlert(WebView* webview,
+void RenderView::RunJavaScriptAlert(WebFrame* webframe,
const std::wstring& message) {
RunJavaScriptMessage(MessageBoxView::kIsJavascriptAlert,
message,
std::wstring(),
+ webframe->GetURL(),
NULL);
}
-bool RenderView::RunJavaScriptConfirm(WebView* webview,
+bool RenderView::RunJavaScriptConfirm(WebFrame* webframe,
const std::wstring& message) {
return RunJavaScriptMessage(MessageBoxView::kIsJavascriptConfirm,
message,
std::wstring(),
+ webframe->GetURL(),
NULL);
}
-bool RenderView::RunJavaScriptPrompt(WebView* webview,
+bool RenderView::RunJavaScriptPrompt(WebFrame* webframe,
const std::wstring& message,
const std::wstring& default_value,
std::wstring* result) {
return RunJavaScriptMessage(MessageBoxView::kIsJavascriptPrompt,
message,
default_value,
+ webframe->GetURL(),
result);
}
bool RenderView::RunJavaScriptMessage(int type,
const std::wstring& message,
const std::wstring& default_value,
+ const GURL& frame_url,
std::wstring* result) {
bool success = false;
std::wstring result_temp;
if (!result)
result = &result_temp;
IPC::SyncMessage* msg = new ViewHostMsg_RunJavaScriptMessage(
- routing_id_, message, default_value, type, &success, result);
+ routing_id_, message, default_value, frame_url, type, &success, result);
msg->set_pump_messages_event(modal_dialog_event_.get());
Send(msg);
@@ -1709,14 +1713,14 @@ void RenderView::AddGURLSearchProvider(const GURL& osd_url, bool autodetected) {
autodetected));
}
-bool RenderView::RunBeforeUnloadConfirm(WebView* webview,
+bool RenderView::RunBeforeUnloadConfirm(WebFrame* webframe,
const std::wstring& message) {
bool success = false;
// This is an ignored return value, but is included so we can accept the same
// response as RunJavaScriptMessage.
std::wstring ignored_result;
IPC::SyncMessage* msg = new ViewHostMsg_RunBeforeUnloadConfirm(
- routing_id_, message, &success, &ignored_result);
+ routing_id_, webframe->GetURL(), message, &success, &ignored_result);
msg->set_pump_messages_event(modal_dialog_event_.get());
Send(msg);
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 1c0078c..700faa9 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -142,15 +142,15 @@ class RenderView : public RenderWidget,
virtual void ShowModalHTMLDialog(const GURL& url, int width, int height,
const std::string& json_arguments,
std::string* json_retval);
- virtual void RunJavaScriptAlert(WebView* webview,
+ virtual void RunJavaScriptAlert(WebFrame* webframe,
const std::wstring& message);
- virtual bool RunJavaScriptConfirm(WebView* webview,
+ virtual bool RunJavaScriptConfirm(WebFrame* webframe,
const std::wstring& message);
- virtual bool RunJavaScriptPrompt(WebView* webview,
+ virtual bool RunJavaScriptPrompt(WebFrame* webframe,
const std::wstring& message,
const std::wstring& default_value,
std::wstring* result);
- virtual bool RunBeforeUnloadConfirm(WebView* webview,
+ virtual bool RunBeforeUnloadConfirm(WebFrame* webframe,
const std::wstring& message);
virtual void EnableSuddenTermination();
virtual void DisableSuddenTermination();
@@ -430,6 +430,7 @@ class RenderView : public RenderWidget,
bool RunJavaScriptMessage(int type,
const std::wstring& message,
const std::wstring& default_value,
+ const GURL& frame_url,
std::wstring* result);
// Adds search provider from the given OpenSearch description URL as a