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.
5 #include "ios/chrome/browser/infobars/infobar_utils.h"
7 #include "base/mac/scoped_nsobject.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "components/infobars/core/confirm_infobar_delegate.h"
10 #include "ios/chrome/browser/infobars/confirm_infobar_controller.h"
11 #include "ios/chrome/browser/infobars/infobar.h"
13 scoped_ptr<infobars::InfoBar> CreateConfirmInfoBar(
14 scoped_ptr<ConfirmInfoBarDelegate> delegate) {
15 scoped_ptr<InfoBarIOS> infobar(new InfoBarIOS(delegate.Pass()));
16 base::scoped_nsobject<ConfirmInfoBarController> controller(
17 [[ConfirmInfoBarController alloc] initWithDelegate:infobar.get()]);
18 infobar->SetController(controller);
19 return infobar.Pass();