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

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

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
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: chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc
===================================================================
--- chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc (revision 238220)
+++ chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc (working copy)
@@ -9,6 +9,7 @@
#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"
@@ -17,6 +18,9 @@
#include "ui/base/l10n/l10n_util.h"
+AlternateNavInfoBarDelegate::~AlternateNavInfoBarDelegate() {
+}
+
// static
void AlternateNavInfoBarDelegate::Create(
content::WebContents* web_contents,
@@ -25,20 +29,18 @@
const GURL& search_url) {
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents);
- infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
- new AlternateNavInfoBarDelegate(
- infobar_service,
+ infobar_service->AddInfoBar(AlternateNavInfoBarDelegate::CreateInfoBar(
+ scoped_ptr<AlternateNavInfoBarDelegate>(new AlternateNavInfoBarDelegate(
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(owner),
+ : InfoBarDelegate(),
profile_(profile),
text_(text),
match_(match),
@@ -47,8 +49,8 @@
DCHECK(search_url_.is_valid());
}
-AlternateNavInfoBarDelegate::~AlternateNavInfoBarDelegate() {
-}
+// AlternateNavInfoBarDelegate::CreateInfoBar() is implemented in
+// platform-specific files.
string16 AlternateNavInfoBarDelegate::GetMessageTextWithOffset(
size_t* link_offset) const {
« no previous file with comments | « chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h ('k') | chrome/browser/ui/startup/autolaunch_prompt_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698