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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm

Issue 1446623003: [Reland] Enable AutoResize for Constrained Web Dialogs for Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/strings/sys_string_conversions.h" 7 #include "base/strings/sys_string_conversions.h"
8 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" 8 #include "chrome/browser/ui/autofill/autofill_dialog_models.h"
9 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" 9 #include "chrome/browser/ui/autofill/autofill_dialog_types.h"
10 #include "chrome/browser/ui/chrome_style.h" 10 #include "chrome/browser/ui/chrome_style.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 CardUnmaskPromptViewBridge::~CardUnmaskPromptViewBridge() { 80 CardUnmaskPromptViewBridge::~CardUnmaskPromptViewBridge() {
81 } 81 }
82 82
83 void CardUnmaskPromptViewBridge::Show() { 83 void CardUnmaskPromptViewBridge::Show() {
84 // Setup the constrained window that will show the view. 84 // Setup the constrained window that will show the view.
85 base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc] 85 base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc]
86 initWithContentRect:[[view_controller_ view] bounds]]); 86 initWithContentRect:[[view_controller_ view] bounds]]);
87 [window setContentView:[view_controller_ view]]; 87 [window setContentView:[view_controller_ view]];
88 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( 88 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet(
89 [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]); 89 [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]);
90 constrained_window_.reset( 90 constrained_window_ =
91 new ConstrainedWindowMac(this, web_contents_, sheet)); 91 CreateAndShowWebModalDialogMac(this, web_contents_, sheet);
92 } 92 }
93 93
94 void CardUnmaskPromptViewBridge::ControllerGone() { 94 void CardUnmaskPromptViewBridge::ControllerGone() {
95 controller_ = nullptr; 95 controller_ = nullptr;
96 PerformClose(); 96 PerformClose();
97 } 97 }
98 98
99 void CardUnmaskPromptViewBridge::DisableAndWaitForVerification() { 99 void CardUnmaskPromptViewBridge::DisableAndWaitForVerification() {
100 [view_controller_ setProgressOverlayText: 100 [view_controller_ setProgressOverlayText:
101 l10n_util::GetStringUTF16( 101 l10n_util::GetStringUTF16(
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 [verifyButton_ setAction:@selector(onVerify:)]; 735 [verifyButton_ setAction:@selector(onVerify:)];
736 [verifyButton_ sizeToFit]; 736 [verifyButton_ sizeToFit];
737 [self updateVerifyButtonEnabled]; 737 [self updateVerifyButtonEnabled];
738 [mainView addSubview:verifyButton_]; 738 [mainView addSubview:verifyButton_];
739 739
740 [self setView:mainView]; 740 [self setView:mainView];
741 [self performLayoutAndDisplay:NO]; 741 [self performLayoutAndDisplay:NO];
742 } 742 }
743 743
744 @end 744 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.h ('k') | chrome/browser/ui/cocoa/certificate_viewer_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698