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

Unified Diff: chrome/browser/infobars/infobar_delegate.cc

Issue 15067008: [InfoBar] Add InfoBarDelegate::GetIconID() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit fixes Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/infobars/infobar_delegate.cc
diff --git a/chrome/browser/infobars/infobar_delegate.cc b/chrome/browser/infobars/infobar_delegate.cc
index 719b99fa6fa88b4616c75ffd2194d4c904b90bc8..b6c23fe3c5388048f0230e90a06ce4579b192855 100644
--- a/chrome/browser/infobars/infobar_delegate.cc
+++ b/chrome/browser/infobars/infobar_delegate.cc
@@ -11,6 +11,7 @@
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
+#include "ui/base/resource/resource_bundle.h"
using content::NavigationEntry;
@@ -39,8 +40,8 @@ bool InfoBarDelegate::ShouldExpire(
void InfoBarDelegate::InfoBarDismissed() {
}
-gfx::Image* InfoBarDelegate::GetIcon() const {
- return NULL;
+int InfoBarDelegate::GetIconID() const {
+ return kNoIconID;
}
InfoBarDelegate::Type InfoBarDelegate::GetInfoBarType() const {
@@ -91,6 +92,12 @@ TranslateInfoBarDelegate* InfoBarDelegate::AsTranslateInfoBarDelegate() {
return NULL;
}
+gfx::Image InfoBarDelegate::GetIcon() const {
+ int icon_id = GetIconID();
+ return (icon_id == kNoIconID) ? gfx::Image() :
+ ResourceBundle::GetSharedInstance().GetNativeImageNamed(icon_id);
+}
+
InfoBarDelegate::InfoBarDelegate(InfoBarService* infobar_service)
: contents_unique_id_(0),
owner_(infobar_service) {

Powered by Google App Engine
This is Rietveld 408576698