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 #import "chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.h" | 5 #import "chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 ui::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); | 56 ui::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); |
57 AlternateNavInfoBarDelegate* delegate = | 57 AlternateNavInfoBarDelegate* delegate = |
58 static_cast<AlternateNavInfoBarDelegate*>([self delegate]); | 58 static_cast<AlternateNavInfoBarDelegate*>([self delegate]); |
59 if (delegate->LinkClicked(disposition)) | 59 if (delegate->LinkClicked(disposition)) |
60 [self removeSelf]; | 60 [self removeSelf]; |
61 } | 61 } |
62 | 62 |
63 @end | 63 @end |
64 | 64 |
65 // static | 65 // static |
66 scoped_ptr<infobars::InfoBar> AlternateNavInfoBarDelegate::CreateInfoBar( | 66 std::unique_ptr<infobars::InfoBar> AlternateNavInfoBarDelegate::CreateInfoBar( |
67 scoped_ptr<AlternateNavInfoBarDelegate> delegate) { | 67 std::unique_ptr<AlternateNavInfoBarDelegate> delegate) { |
68 scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); | 68 std::unique_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); |
69 base::scoped_nsobject<AlternateNavInfoBarController> controller( | 69 base::scoped_nsobject<AlternateNavInfoBarController> controller( |
70 [[AlternateNavInfoBarController alloc] initWithInfoBar:infobar.get()]); | 70 [[AlternateNavInfoBarController alloc] initWithInfoBar:infobar.get()]); |
71 infobar->set_controller(controller); | 71 infobar->set_controller(controller); |
72 return std::move(infobar); | 72 return std::move(infobar); |
73 } | 73 } |
OLD | NEW |