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

Unified Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.cc

Issue 319013002: Reland Fix Views web-modal dialog widget creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert MediaGalleriesScanResultDialogViews::AcceptDialogForTesting. Created 6 years, 6 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/ui/views/autofill/autofill_dialog_views.cc
diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
index 6f526c77d0821578980d1c07e1033c9e77eaeccc..72d99f31b4075fb7936d68986042a32bdbbf4d35 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
@@ -67,9 +67,6 @@
#include "ui/views/window/dialog_client_view.h"
#include "ui/views/window/non_client_view.h"
-using web_modal::WebContentsModalDialogManager;
-using web_modal::WebContentsModalDialogManagerDelegate;
-
namespace autofill {
namespace {
@@ -1241,18 +1238,7 @@ void AutofillDialogViews::Show() {
UpdateNotificationArea();
UpdateButtonStripExtraView();
- // Ownership of |contents_| is handed off by this call. The widget will take
- // care of deleting itself after calling DeleteDelegate().
- WebContentsModalDialogManager* web_contents_modal_dialog_manager =
- WebContentsModalDialogManager::FromWebContents(
- delegate_->GetWebContents());
- WebContentsModalDialogManagerDelegate* modal_delegate =
- web_contents_modal_dialog_manager->delegate();
- DCHECK(modal_delegate);
- window_ = views::Widget::CreateWindowAsFramelessChild(
- this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView());
- web_contents_modal_dialog_manager->ShowModalDialog(
- window_->GetNativeView());
+ window_ = ShowWebModalDialogViews(this, delegate_->GetWebContents());
focus_manager_ = window_->GetFocusManager();
focus_manager_->AddFocusChangeListener(this);
@@ -1536,6 +1522,10 @@ void AutofillDialogViews::OnNativeThemeChanged(
legal_document_view_->SetDefaultStyle(default_style);
}
+ui::ModalType AutofillDialogViews::GetModalType() const {
+ return ui::MODAL_TYPE_CHILD;
+}
+
base::string16 AutofillDialogViews::GetWindowTitle() const {
base::string16 title = delegate_->DialogTitle();
// Hack alert: we don't want the dialog to jiggle when a title is added or
@@ -1808,7 +1798,7 @@ gfx::Size AutofillDialogViews::GetMinimumSignInViewSize() const {
gfx::Size AutofillDialogViews::GetMaximumSignInViewSize() const {
web_modal::WebContentsModalDialogHost* dialog_host =
- WebContentsModalDialogManager::FromWebContents(
+ web_modal::WebContentsModalDialogManager::FromWebContents(
delegate_->GetWebContents())->delegate()->
GetWebContentsModalDialogHost();
@@ -2330,7 +2320,7 @@ void AutofillDialogViews::ContentsPreferredSizeChanged() {
if (GetWidget() && delegate_ && delegate_->GetWebContents()) {
UpdateWebContentsModalDialogPosition(
GetWidget(),
- WebContentsModalDialogManager::FromWebContents(
+ web_modal::WebContentsModalDialogManager::FromWebContents(
delegate_->GetWebContents())->delegate()->
GetWebContentsModalDialogHost());
SetBoundsRect(bounds());
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_dialog_views.h ('k') | chrome/browser/ui/views/collected_cookies_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698