Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: components/infobars/core/confirm_infobar_delegate.cc

Issue 812823002: Remove dependency of infobars component on the embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests by instanciating a TestConfirmInfoBarDelegateFactory Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/infobars/core/confirm_infobar_delegate.cc
diff --git a/components/infobars/core/confirm_infobar_delegate.cc b/components/infobars/core/confirm_infobar_delegate.cc
index 0c2e59e5ad239dc3940ef706b84f0a1666de0a03..7fd659b40f24c8f5dc8d140aa041e92c94e531cf 100644
--- a/components/infobars/core/confirm_infobar_delegate.cc
+++ b/components/infobars/core/confirm_infobar_delegate.cc
@@ -4,6 +4,9 @@
#include "components/infobars/core/confirm_infobar_delegate.h"
+#include "base/logging.h"
+#include "components/infobars/core/confirm_infobar_delegate_factory.h"
+#include "components/infobars/core/infobar.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/strings/grit/ui_strings.h"
@@ -51,6 +54,15 @@ ConfirmInfoBarDelegate::ConfirmInfoBarDelegate()
: InfoBarDelegate() {
}
+// static
+scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar(
+ scoped_ptr<ConfirmInfoBarDelegate> delegate) {
+ DCHECK(ConfirmInfoBarDelegateFactory::GetInstance())
+ << "No ConfirmInfoBarDelegateFactory registered";
+ return ConfirmInfoBarDelegateFactory::GetInstance()->CreateInfoBar(
+ delegate.Pass());
+}
+
bool ConfirmInfoBarDelegate::ShouldExpireInternal(
const NavigationDetails& details) const {
return !details.did_replace_entry &&

Powered by Google App Engine
This is Rietveld 408576698