| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h" | 5 #include "chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| 11 #include "grit/theme_resources.h" | 11 #include "grit/theme_resources.h" |
| 12 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
| 13 #include "ui/base/resource/resource_bundle.h" | |
| 14 | 13 |
| 15 // static | 14 // static |
| 16 void AlternateNavInfoBarDelegate::Create(InfoBarService* infobar_service, | 15 void AlternateNavInfoBarDelegate::Create(InfoBarService* infobar_service, |
| 17 const GURL& alternate_nav_url) { | 16 const GURL& alternate_nav_url) { |
| 18 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( | 17 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( |
| 19 new AlternateNavInfoBarDelegate(infobar_service, alternate_nav_url))); | 18 new AlternateNavInfoBarDelegate(infobar_service, alternate_nav_url))); |
| 20 } | 19 } |
| 21 | 20 |
| 22 AlternateNavInfoBarDelegate::AlternateNavInfoBarDelegate( | 21 AlternateNavInfoBarDelegate::AlternateNavInfoBarDelegate( |
| 23 InfoBarService* owner, | 22 InfoBarService* owner, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 49 // the future. | 48 // the future. |
| 50 content::PAGE_TRANSITION_TYPED, | 49 content::PAGE_TRANSITION_TYPED, |
| 51 false); | 50 false); |
| 52 web_contents()->OpenURL(params); | 51 web_contents()->OpenURL(params); |
| 53 | 52 |
| 54 // We should always close, even if the navigation did not occur within this | 53 // We should always close, even if the navigation did not occur within this |
| 55 // WebContents. | 54 // WebContents. |
| 56 return true; | 55 return true; |
| 57 } | 56 } |
| 58 | 57 |
| 59 gfx::Image* AlternateNavInfoBarDelegate::GetIcon() const { | 58 int AlternateNavInfoBarDelegate::GetIconID() const { |
| 60 return &ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 59 return IDR_INFOBAR_ALT_NAV_URL; |
| 61 IDR_INFOBAR_ALT_NAV_URL); | |
| 62 } | 60 } |
| 63 | 61 |
| 64 InfoBarDelegate::Type AlternateNavInfoBarDelegate::GetInfoBarType() const { | 62 InfoBarDelegate::Type AlternateNavInfoBarDelegate::GetInfoBarType() const { |
| 65 return PAGE_ACTION_TYPE; | 63 return PAGE_ACTION_TYPE; |
| 66 } | 64 } |
| OLD | NEW |