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

Side by Side Diff: chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm

Issue 12276010: Factor out uses of the WebContentsModalDialog interface from platform-independent code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove incorrect override Created 7 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 | 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/memory/scoped_nsobject.h" 7 #include "base/memory/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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 target:bridge_ 70 target:bridge_
71 action:@selector(onCancelButton:)]; 71 action:@selector(onCancelButton:)];
72 [[alert_ closeButton] setTarget:bridge_]; 72 [[alert_ closeButton] setTarget:bridge_];
73 [[alert_ closeButton] setAction:@selector(onCancelButton:)]; 73 [[alert_ closeButton] setAction:@selector(onCancelButton:)];
74 [alert_ layout]; 74 [alert_ layout];
75 75
76 scoped_nsobject<CustomConstrainedWindowSheet> sheet( 76 scoped_nsobject<CustomConstrainedWindowSheet> sheet(
77 [[CustomConstrainedWindowSheet alloc] 77 [[CustomConstrainedWindowSheet alloc]
78 initWithCustomWindow:[alert_ window]]); 78 initWithCustomWindow:[alert_ window]]);
79 window_.reset(new ConstrainedWindowMac(this, web_contents, sheet)); 79 window_.reset(new ConstrainedWindowMac(this, web_contents, sheet));
80 delegate->set_window(window_.get()); 80 delegate_->set_close_delegate(this);
81 } 81 }
82 82
83 TabModalConfirmDialogMac::~TabModalConfirmDialogMac() { 83 TabModalConfirmDialogMac::~TabModalConfirmDialogMac() {
84 } 84 }
85 85
86 void TabModalConfirmDialogMac::AcceptTabModalDialog() { 86 void TabModalConfirmDialogMac::AcceptTabModalDialog() {
87 delegate_->Accept(); 87 delegate_->Accept();
88 } 88 }
89 89
90 void TabModalConfirmDialogMac::CancelTabModalDialog() { 90 void TabModalConfirmDialogMac::CancelTabModalDialog() {
91 delegate_->Cancel(); 91 delegate_->Cancel();
92 } 92 }
93 93
94 void TabModalConfirmDialogMac::CloseDialog() {
95 window_->CloseWebContentsModalDialog();
96 }
97
94 void TabModalConfirmDialogMac::OnConstrainedWindowClosed( 98 void TabModalConfirmDialogMac::OnConstrainedWindowClosed(
95 ConstrainedWindowMac* window) { 99 ConstrainedWindowMac* window) {
96 delete this; 100 delete this;
97 } 101 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h ('k') | chrome/browser/ui/gtk/constrained_web_dialog_delegate_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698