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> |
| 10 |
9 #include "base/logging.h" | 11 #include "base/logging.h" |
10 #include "base/strings/sys_string_conversions.h" | 12 #include "base/strings/sys_string_conversions.h" |
11 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" | 13 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" |
12 #include "chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h" | 14 #include "chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h" |
13 #import "ui/base/cocoa/cocoa_base_utils.h" | 15 #import "ui/base/cocoa/cocoa_base_utils.h" |
14 #import "ui/base/cocoa/controls/hyperlink_text_view.h" | 16 #import "ui/base/cocoa/controls/hyperlink_text_view.h" |
15 #include "ui/base/window_open_disposition.h" | 17 #include "ui/base/window_open_disposition.h" |
16 | 18 |
17 @implementation AlternateNavInfoBarController | 19 @implementation AlternateNavInfoBarController |
18 | 20 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 static_cast<AlternateNavInfoBarDelegate*>([self delegate]); | 58 static_cast<AlternateNavInfoBarDelegate*>([self delegate]); |
57 if (delegate->LinkClicked(disposition)) | 59 if (delegate->LinkClicked(disposition)) |
58 [self removeSelf]; | 60 [self removeSelf]; |
59 } | 61 } |
60 | 62 |
61 @end | 63 @end |
62 | 64 |
63 // static | 65 // static |
64 scoped_ptr<infobars::InfoBar> AlternateNavInfoBarDelegate::CreateInfoBar( | 66 scoped_ptr<infobars::InfoBar> AlternateNavInfoBarDelegate::CreateInfoBar( |
65 scoped_ptr<AlternateNavInfoBarDelegate> delegate) { | 67 scoped_ptr<AlternateNavInfoBarDelegate> delegate) { |
66 scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass())); | 68 scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); |
67 base::scoped_nsobject<AlternateNavInfoBarController> controller( | 69 base::scoped_nsobject<AlternateNavInfoBarController> controller( |
68 [[AlternateNavInfoBarController alloc] initWithInfoBar:infobar.get()]); | 70 [[AlternateNavInfoBarController alloc] initWithInfoBar:infobar.get()]); |
69 infobar->set_controller(controller); | 71 infobar->set_controller(controller); |
70 return infobar.Pass(); | 72 return std::move(infobar); |
71 } | 73 } |
OLD | NEW |