diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 20:18:07 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 20:18:07 +0000 |
commit | a455d381543e773418e645b3192c8731430a646e (patch) | |
tree | f52ea9e8a6a2db06957637b8698d7c5007b2e4a5 /chrome/renderer/render_view.cc | |
parent | 2eb312b025971ee1529b3a6c67d715055cb77906 (diff) | |
download | chromium_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/render_view.cc')
-rw-r--r-- | chrome/renderer/render_view.cc | 16 |
1 files changed, 10 insertions, 6 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); |