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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm

Issue 657333002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/infobars/confirm_infobar_controller.h" 5 #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" 9 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h"
10 #include "components/infobars/core/confirm_infobar_delegate.h" 10 #include "components/infobars/core/confirm_infobar_delegate.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 ui::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); 133 ui::WindowOpenDispositionFromNSEvent([NSApp currentEvent]);
134 if ([self delegate]->AsConfirmInfoBarDelegate()->LinkClicked(disposition)) 134 if ([self delegate]->AsConfirmInfoBarDelegate()->LinkClicked(disposition))
135 [self removeSelf]; 135 [self removeSelf];
136 } 136 }
137 137
138 @end 138 @end
139 139
140 // static 140 // static
141 scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar( 141 scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar(
142 scoped_ptr<ConfirmInfoBarDelegate> delegate) { 142 scoped_ptr<ConfirmInfoBarDelegate> delegate) {
143 scoped_ptr<InfoBarCocoa> infobar( 143 scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass()));
144 new InfoBarCocoa(delegate.PassAs<infobars::InfoBarDelegate>()));
145 base::scoped_nsobject<ConfirmInfoBarController> controller( 144 base::scoped_nsobject<ConfirmInfoBarController> controller(
146 [[ConfirmInfoBarController alloc] initWithInfoBar:infobar.get()]); 145 [[ConfirmInfoBarController alloc] initWithInfoBar:infobar.get()]);
147 infobar->set_controller(controller); 146 infobar->set_controller(controller);
148 return infobar.PassAs<infobars::InfoBar>(); 147 return infobar.Pass();
149 } 148 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698