OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "components/infobars/core/confirm_infobar_delegate.h" | |
6 | |
7 #include "base/mac/scoped_nsobject.h" | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "ios/chrome/browser/infobars/confirm_infobar_controller.h" | |
10 #include "ios/chrome/browser/infobars/infobar.h" | |
11 | |
12 // This function is defined in the component, but implemented in the embedder. | |
13 // static | |
14 scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar( | |
15 scoped_ptr<ConfirmInfoBarDelegate> delegate) { | |
16 scoped_ptr<InfoBarIOS> infobar(new InfoBarIOS(delegate.Pass())); | |
17 base::scoped_nsobject<ConfirmInfoBarController> controller( | |
18 [[ConfirmInfoBarController alloc] initWithDelegate:infobar.get()]); | |
19 infobar->SetController(controller); | |
20 return infobar.Pass(); | |
21 } | |
OLD | NEW |