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/test/test_confirm_infobar_delegate_factory.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 9 #include "components/infobars/core/infobar.h" |
| 10 |
| 11 TestConfirmInfoBarDelegateFactory::TestConfirmInfoBarDelegateFactory() { |
| 12 DCHECK(!ConfirmInfoBarDelegateFactory::GetInstance()); |
| 13 ConfirmInfoBarDelegateFactory::SetInstance(this); |
| 14 } |
| 15 |
| 16 TestConfirmInfoBarDelegateFactory::~TestConfirmInfoBarDelegateFactory() { |
| 17 DCHECK_EQ(ConfirmInfoBarDelegateFactory::GetInstance(), this); |
| 18 ConfirmInfoBarDelegateFactory::SetInstance(nullptr); |
| 19 } |
| 20 |
| 21 scoped_ptr<infobars::InfoBar> TestConfirmInfoBarDelegateFactory::CreateInfoBar( |
| 22 scoped_ptr<ConfirmInfoBarDelegate> delegate) { |
| 23 return make_scoped_ptr(new infobars::InfoBar(delegate.Pass())); |
| 24 } |
OLD | NEW |