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

Unified Diff: trunk/src/chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc

Issue 102163002: Revert 238283 "Infobar system refactor." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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: trunk/src/chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc
===================================================================
--- trunk/src/chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc (revision 238401)
+++ trunk/src/chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc (working copy)
@@ -9,7 +9,6 @@
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/shortcuts_backend.h"
#include "chrome/browser/history/shortcuts_backend_factory.h"
-#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/web_contents.h"
@@ -18,9 +17,6 @@
#include "ui/base/l10n/l10n_util.h"
-AlternateNavInfoBarDelegate::~AlternateNavInfoBarDelegate() {
-}
-
// static
void AlternateNavInfoBarDelegate::Create(
content::WebContents* web_contents,
@@ -29,18 +25,20 @@
const GURL& search_url) {
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents);
- infobar_service->AddInfoBar(AlternateNavInfoBarDelegate::CreateInfoBar(
- scoped_ptr<AlternateNavInfoBarDelegate>(new AlternateNavInfoBarDelegate(
+ infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
+ new AlternateNavInfoBarDelegate(
+ infobar_service,
Profile::FromBrowserContext(web_contents->GetBrowserContext()), text,
- match, search_url))));
+ match, search_url)));
}
AlternateNavInfoBarDelegate::AlternateNavInfoBarDelegate(
+ InfoBarService* owner,
Profile* profile,
const string16& text,
const AutocompleteMatch& match,
const GURL& search_url)
- : InfoBarDelegate(),
+ : InfoBarDelegate(owner),
profile_(profile),
text_(text),
match_(match),
@@ -49,8 +47,8 @@
DCHECK(search_url_.is_valid());
}
-// AlternateNavInfoBarDelegate::CreateInfoBar() is implemented in
-// platform-specific files.
+AlternateNavInfoBarDelegate::~AlternateNavInfoBarDelegate() {
+}
string16 AlternateNavInfoBarDelegate::GetMessageTextWithOffset(
size_t* link_offset) const {

Powered by Google App Engine
This is Rietveld 408576698