| 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 {
|
|
|