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

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

Issue 17500003: Close web contents modal dialogs on content load start (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compilation fixes, change "inhibit" variable names Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h" 5 #include "chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h"
6 6
7 #include "base/mac/bundle_locations.h" 7 #include "base/mac/bundle_locations.h"
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" 9 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h"
10 #include "chrome/browser/ui/chrome_style.h" 10 #include "chrome/browser/ui/chrome_style.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // This should only be called once. 47 // This should only be called once.
48 DCHECK(!sheet_controller_.get()); 48 DCHECK(!sheet_controller_.get());
49 sheet_controller_.reset([[AutofillDialogWindowController alloc] 49 sheet_controller_.reset([[AutofillDialogWindowController alloc]
50 initWithWebContents:controller_->web_contents() 50 initWithWebContents:controller_->web_contents()
51 autofillDialog:this]); 51 autofillDialog:this]);
52 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( 52 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet(
53 [[CustomConstrainedWindowSheet alloc] 53 [[CustomConstrainedWindowSheet alloc]
54 initWithCustomWindow:[sheet_controller_ window]]); 54 initWithCustomWindow:[sheet_controller_ window]]);
55 constrained_window_.reset( 55 constrained_window_.reset(
56 new ConstrainedWindowMac(this, controller_->web_contents(), sheet)); 56 new ConstrainedWindowMac(this, controller_->web_contents(), sheet));
57 constrained_window_->SetPreventCloseOnLoadStart(true);
57 } 58 }
58 59
59 void AutofillDialogCocoa::Hide() { 60 void AutofillDialogCocoa::Hide() {
60 [sheet_controller_ hide]; 61 [sheet_controller_ hide];
61 } 62 }
62 63
63 // Closes the sheet and ends the modal loop. Triggers cleanup sequence. 64 // Closes the sheet and ends the modal loop. Triggers cleanup sequence.
64 void AutofillDialogCocoa::PerformClose() { 65 void AutofillDialogCocoa::PerformClose() {
65 constrained_window_->CloseWebContentsModalDialog(); 66 constrained_window_->CloseWebContentsModalDialog();
66 } 67 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 [[signInContainer_ view] setHidden:YES]; 331 [[signInContainer_ view] setHidden:YES];
331 [[mainContainer_ view] setHidden:NO]; 332 [[mainContainer_ view] setHidden:NO];
332 [self performLayout]; 333 [self performLayout];
333 } 334 }
334 335
335 - (void)modelChanged { 336 - (void)modelChanged {
336 [mainContainer_ modelChanged]; 337 [mainContainer_ modelChanged];
337 } 338 }
338 339
339 @end 340 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698