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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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) 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 <utility> 7 #include <utility>
8 8
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "chrome/browser/ui/browser_dialogs.h" 10 #include "chrome/browser/ui/browser_dialogs.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 window_->CloseWebContentsModalDialog(); 115 window_->CloseWebContentsModalDialog();
116 } 116 }
117 } 117 }
118 118
119 void TabModalConfirmDialogMac::OnConstrainedWindowClosed( 119 void TabModalConfirmDialogMac::OnConstrainedWindowClosed(
120 ConstrainedWindowMac* window) { 120 ConstrainedWindowMac* window) {
121 // If this method should mistakenly be called during Delegate::Close(), 121 // If this method should mistakenly be called during Delegate::Close(),
122 // prevent a double-delete by moving delegate_ to a stack variable. 122 // prevent a double-delete by moving delegate_ to a stack variable.
123 if (!delegate_) 123 if (!delegate_)
124 return; 124 return;
125 scoped_ptr<TabModalConfirmDialogDelegate> delegate(std::move(delegate_)); 125 std::unique_ptr<TabModalConfirmDialogDelegate> delegate(std::move(delegate_));
126 // Provide a disposition in case the dialog was closed without accepting or 126 // Provide a disposition in case the dialog was closed without accepting or
127 // cancelling. 127 // cancelling.
128 delegate->Close(); 128 delegate->Close();
129 delete this; 129 delete this;
130 } 130 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h ('k') | chrome/browser/ui/cocoa/tabs/alert_indicator_button_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698