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

Unified Diff: chrome/browser/views/modal_dialog_delegate.cc

Issue 560030: Refactored out JS specific part of modal dialog stack into its own class, exp... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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/views/modal_dialog_delegate.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/modal_dialog_delegate.cc
===================================================================
--- chrome/browser/views/modal_dialog_delegate.cc (revision 0)
+++ chrome/browser/views/modal_dialog_delegate.cc (revision 0)
@@ -0,0 +1,37 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/views/modal_dialog_delegate.h"
+
+#include "views/window/window.h"
+
+void ModalDialogDelegate::ShowModalDialog() {
+ gfx::NativeWindow root_hwnd = GetDialogRootWindow();
+ // GetMessageBoxRootWindow() will be NULL if there's no selected tab (e.g.,
+ // during shutdown), in which case we simply skip showing this dialog.
+ if (!root_hwnd) {
+ Cancel();
+ } else {
+ dialog_ = views::Window::CreateChromeWindow(root_hwnd, gfx::Rect(), this);
+ dialog_->Show();
+ }
+}
+
+void ModalDialogDelegate::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();
+}
+
+void ModalDialogDelegate::CloseModalDialog() {
+ // If the dialog is visible close it.
+ if (dialog_)
+ dialog_->Close();
+}
+
+ModalDialogDelegate::ModalDialogDelegate() : dialog_(NULL) {
+}
+
Property changes on: chrome/browser/views/modal_dialog_delegate.cc
___________________________________________________________________
Name: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/views/modal_dialog_delegate.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698