OLD | NEW |
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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 if (![self isOwned]) | 140 if (![self isOwned]) |
141 return; | 141 return; |
142 WindowOpenDisposition disposition = | 142 WindowOpenDisposition disposition = |
143 ui::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); | 143 ui::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); |
144 if ([self delegate]->AsConfirmInfoBarDelegate()->LinkClicked(disposition)) | 144 if ([self delegate]->AsConfirmInfoBarDelegate()->LinkClicked(disposition)) |
145 [self removeSelf]; | 145 [self removeSelf]; |
146 } | 146 } |
147 | 147 |
148 @end | 148 @end |
149 | 149 |
150 scoped_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( | 150 std::unique_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( |
151 scoped_ptr<ConfirmInfoBarDelegate> delegate) { | 151 std::unique_ptr<ConfirmInfoBarDelegate> delegate) { |
152 scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); | 152 std::unique_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); |
153 base::scoped_nsobject<ConfirmInfoBarController> controller( | 153 base::scoped_nsobject<ConfirmInfoBarController> controller( |
154 [[ConfirmInfoBarController alloc] initWithInfoBar:infobar.get()]); | 154 [[ConfirmInfoBarController alloc] initWithInfoBar:infobar.get()]); |
155 infobar->set_controller(controller); | 155 infobar->set_controller(controller); |
156 return std::move(infobar); | 156 return std::move(infobar); |
157 } | 157 } |
OLD | NEW |