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

Side by Side Diff: chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/tab_modal_confirm_dialog_mac.h" 5 #include "chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "chrome/browser/ui/browser_dialogs.h" 8 #include "chrome/browser/ui/browser_dialogs.h"
9 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h" 9 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h"
10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh eet.h" 10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh eet.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 target:bridge_ 81 target:bridge_
82 action:@selector(onCancelButton:)]; 82 action:@selector(onCancelButton:)];
83 [[alert_ closeButton] setTarget:bridge_]; 83 [[alert_ closeButton] setTarget:bridge_];
84 [[alert_ closeButton] setAction:@selector(onCancelButton:)]; 84 [[alert_ closeButton] setAction:@selector(onCancelButton:)];
85 [alert_ layout]; 85 [alert_ layout];
86 86
87 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( 87 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet(
88 [[CustomConstrainedWindowSheet alloc] 88 [[CustomConstrainedWindowSheet alloc]
89 initWithCustomWindow:[alert_ window]]); 89 initWithCustomWindow:[alert_ window]]);
90 window_.reset(new ConstrainedWindowMac(this, web_contents, sheet)); 90 window_.reset(new ConstrainedWindowMac(this, web_contents, sheet));
91 delegate_->set_close_delegate(this); 91 delegate_->set_operations_delegate(this);
92 } 92 }
93 93
94 TabModalConfirmDialogMac::~TabModalConfirmDialogMac() { 94 TabModalConfirmDialogMac::~TabModalConfirmDialogMac() {
95 } 95 }
96 96
97 void TabModalConfirmDialogMac::AcceptTabModalDialog() { 97 void TabModalConfirmDialogMac::AcceptTabModalDialog() {
98 delegate_->Accept(); 98 delegate_->Accept();
99 } 99 }
100 100
101 void TabModalConfirmDialogMac::CancelTabModalDialog() { 101 void TabModalConfirmDialogMac::CancelTabModalDialog() {
102 delegate_->Cancel(); 102 delegate_->Cancel();
103 } 103 }
104 104
105 void TabModalConfirmDialogMac::CloseDialog() { 105 void TabModalConfirmDialogMac::CloseDialog() {
106 window_->CloseWebContentsModalDialog(); 106 window_->CloseWebContentsModalDialog();
107 } 107 }
108 108
109 void TabModalConfirmDialogMac::SetPreventCloseOnLoadStart(bool prevent) {
110 window_->SetPreventCloseOnLoadStart(prevent);
111 }
112
109 void TabModalConfirmDialogMac::OnConstrainedWindowClosed( 113 void TabModalConfirmDialogMac::OnConstrainedWindowClosed(
110 ConstrainedWindowMac* window) { 114 ConstrainedWindowMac* window) {
111 delete this; 115 delete this;
112 } 116 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h ('k') | chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698