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

Unified Diff: chrome/browser/jsmessage_box_handler_win.cc

Issue 27080: AppModalDialogQueue shouldn't depend on views. (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 | « chrome/browser/jsmessage_box_handler_win.h ('k') | chrome/test/unit/unittests.vcproj » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/jsmessage_box_handler_win.cc
===================================================================
--- chrome/browser/jsmessage_box_handler_win.cc (revision 10204)
+++ chrome/browser/jsmessage_box_handler_win.cc (working copy)
@@ -66,6 +66,45 @@
}
//////////////////////////////////////////////////////////////////////////////
+// JavascriptMessageBoxHandler, views::AppModalDialogDelegate
+// implementation:
+
+void JavascriptMessageBoxHandler::ShowModalDialog() {
+ // If the WebContents that created this dialog navigated away before this
+ // dialog became visible, simply show the next dialog if any.
+ if (!web_contents_) {
+ AppModalDialogQueue::ShowNextDialog();
+ delete this;
+ return;
+ }
+
+ web_contents_->Activate();
+ HWND root_hwnd = GetAncestor(web_contents_->GetNativeView(), GA_ROOT);
+ dialog_ = views::Window::CreateChromeWindow(root_hwnd, gfx::Rect(), this);
+ dialog_->Show();
+}
+
+void JavascriptMessageBoxHandler::ActivateModalDialog() {
+ // Ensure that the dialog is visible and at the top of the z-order. These
+ // conditions may not be true if the dialog was opened on a different virtual
+ // desktop to the one the browser window is on.
+ dialog_->Show();
+ dialog_->Activate();
+}
+
+AppModalDialogDelegateTesting*
+JavascriptMessageBoxHandler::GetTestingInterface() {
+ return this;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// JavascriptMessageBoxHandler, AppModalDialogDelegateTesting implementation:
+
+views::DialogDelegate* JavascriptMessageBoxHandler::GetDialogDelegate() {
+ return this;
+}
+
+//////////////////////////////////////////////////////////////////////////////
// JavascriptMessageBoxHandler, views::DialogDelegate implementation:
int JavascriptMessageBoxHandler::GetDialogButtons() const {
@@ -141,33 +180,6 @@
return true;
}
-//////////////////////////////////////////////////////////////////////////////
-// JavascriptMessageBoxHandler, views::AppModalDialogDelegate
-// implementation:
-
-void JavascriptMessageBoxHandler::ShowModalDialog() {
- // If the WebContents that created this dialog navigated away before this
- // dialog became visible, simply show the next dialog if any.
- if (!web_contents_) {
- AppModalDialogQueue::ShowNextDialog();
- delete this;
- return;
- }
-
- web_contents_->Activate();
- HWND root_hwnd = GetAncestor(web_contents_->GetNativeView(), GA_ROOT);
- dialog_ = views::Window::CreateChromeWindow(root_hwnd, gfx::Rect(), this);
- dialog_->Show();
-}
-
-void JavascriptMessageBoxHandler::ActivateModalDialog() {
- // Ensure that the dialog is visible and at the top of the z-order. These
- // conditions may not be true if the dialog was opened on a different virtual
- // desktop to the one the browser window is on.
- dialog_->Show();
- dialog_->Activate();
-}
-
///////////////////////////////////////////////////////////////////////////////
// JavascriptMessageBoxHandler, views::WindowDelegate implementation:
@@ -178,7 +190,7 @@
views::View* JavascriptMessageBoxHandler::GetInitiallyFocusedView() {
if (message_box_view_->text_box())
return message_box_view_->text_box();
- return views::AppModalDialogDelegate::GetInitiallyFocusedView();
+ return views::DialogDelegate::GetInitiallyFocusedView();
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « chrome/browser/jsmessage_box_handler_win.h ('k') | chrome/test/unit/unittests.vcproj » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698