| 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();
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|