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

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 redux 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
« no previous file with comments | « chrome/browser/infobars/infobar_delegate.h ('k') | chrome/browser/infobars/simple_alert_infobar_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6bd2c20742c44c3b6e7d3cbfa0726f2048e9c9b2 100644
--- a/chrome/browser/infobars/infobar_delegate.cc
+++ b/chrome/browser/infobars/infobar_delegate.cc
@@ -11,11 +11,14 @@
#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;
// InfoBarDelegate ------------------------------------------------------------
+const int InfoBarDelegate::kNoIconID = 0;
+
InfoBarDelegate::~InfoBarDelegate() {
}
@@ -39,8 +42,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 +94,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) {
« no previous file with comments | « chrome/browser/infobars/infobar_delegate.h ('k') | chrome/browser/infobars/simple_alert_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698