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

Side by Side Diff: chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc

Issue 12017031: infobars: Remove the downcast AsAlternateNavInfoBarDelegate() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/api/infobars/infobar_service.h" 8 #include "chrome/browser/api/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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()->GetWebContents()->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 AlternateNavInfoBarDelegate*
60 AlternateNavInfoBarDelegate::AsAlternateNavInfoBarDelegate() {
61 return this;
62 }
63
64 gfx::Image* AlternateNavInfoBarDelegate::GetIcon() const { 59 gfx::Image* AlternateNavInfoBarDelegate::GetIcon() const {
65 return &ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( 60 return &ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(
66 IDR_INFOBAR_ALT_NAV_URL); 61 IDR_INFOBAR_ALT_NAV_URL);
67 } 62 }
68 63
69 InfoBarDelegate::Type AlternateNavInfoBarDelegate::GetInfoBarType() const { 64 InfoBarDelegate::Type AlternateNavInfoBarDelegate::GetInfoBarType() const {
70 return PAGE_ACTION_TYPE; 65 return PAGE_ACTION_TYPE;
71 } 66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698