OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |