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" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 bool AlternateNavInfoBarDelegate::LinkClicked( | 43 bool AlternateNavInfoBarDelegate::LinkClicked( |
44 WindowOpenDisposition disposition) { | 44 WindowOpenDisposition disposition) { |
45 content::OpenURLParams params( | 45 content::OpenURLParams params( |
46 alternate_nav_url_, content::Referrer(), disposition, | 46 alternate_nav_url_, content::Referrer(), disposition, |
47 // Pretend the user typed this URL, so that navigating to | 47 // Pretend the user typed this URL, so that navigating to |
48 // it will be the default action when it's typed again in | 48 // it will be the default action when it's typed again in |
49 // the future. | 49 // the future. |
50 content::PAGE_TRANSITION_TYPED, | 50 content::PAGE_TRANSITION_TYPED, |
51 false); | 51 false); |
52 owner()->GetWebContents()->OpenURL(params); | 52 owner()->web_contents()->OpenURL(params); |
53 | 53 |
54 // We should always close, even if the navigation did not occur within this | 54 // We should always close, even if the navigation did not occur within this |
55 // WebContents. | 55 // WebContents. |
56 return true; | 56 return true; |
57 } | 57 } |
58 | 58 |
59 gfx::Image* AlternateNavInfoBarDelegate::GetIcon() const { | 59 gfx::Image* AlternateNavInfoBarDelegate::GetIcon() const { |
60 return &ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 60 return &ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
61 IDR_INFOBAR_ALT_NAV_URL); | 61 IDR_INFOBAR_ALT_NAV_URL); |
62 } | 62 } |
63 | 63 |
64 InfoBarDelegate::Type AlternateNavInfoBarDelegate::GetInfoBarType() const { | 64 InfoBarDelegate::Type AlternateNavInfoBarDelegate::GetInfoBarType() const { |
65 return PAGE_ACTION_TYPE; | 65 return PAGE_ACTION_TYPE; |
66 } | 66 } |
OLD | NEW |