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

Unified Diff: chrome/browser/tab_contents/background_contents.cc

Issue 7096016: Remove JS dialog dependency from content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: now a tc delegate Created 9 years, 7 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: chrome/browser/tab_contents/background_contents.cc
diff --git a/chrome/browser/tab_contents/background_contents.cc b/chrome/browser/tab_contents/background_contents.cc
index cae94e82dd27e5263e6066bda23829236ac2896d..6bad66f904357fcf55862203439ed2aac797500b 100644
--- a/chrome/browser/tab_contents/background_contents.cc
+++ b/chrome/browser/tab_contents/background_contents.cc
@@ -109,8 +109,12 @@ void BackgroundContents::RunJavaScriptMessage(
const int flags,
IPC::Message* reply_msg,
bool* did_suppress_message) {
- // TODO(rafaelw): Implement, The JavaScriptModalDialog needs to learn about
- // BackgroundContents.
+ // TODO(rafaelw): Implement.
+
+ // Since we are suppressing messages, just reply as if the user immediately
+ // pressed "Cancel".
+ OnDialogClosed(reply_msg, false, string16());
+
*did_suppress_message = true;
}
@@ -137,15 +141,15 @@ void BackgroundContents::Observe(NotificationType type,
}
}
-void BackgroundContents::OnMessageBoxClosed(IPC::Message* reply_msg,
- bool success,
- const std::wstring& user_input) {
+void BackgroundContents::OnDialogClosed(IPC::Message* reply_msg,
+ bool success,
+ const string16& user_input) {
render_view_host()->JavaScriptDialogClosed(reply_msg,
success,
- WideToUTF16Hack(user_input));
+ user_input);
}
-gfx::NativeWindow BackgroundContents::GetMessageBoxRootWindow() {
+gfx::NativeWindow BackgroundContents::GetDialogRootWindow() {
NOTIMPLEMENTED();
return NULL;
}

Powered by Google App Engine
This is Rietveld 408576698