summaryrefslogtreecommitdiffstats
path: root/chrome/browser/geolocation
diff options
context:
space:
mode:
authordfalcantara@chromium.org <dfalcantara@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-16 19:03:58 +0000
committerdfalcantara@chromium.org <dfalcantara@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-16 19:03:58 +0000
commita1c8bae3608e6c40f0258fbb780223cdae0b61d5 (patch)
treece49a3456de4bbf6e963285c7357d0c8de0f1fae /chrome/browser/geolocation
parent58253ed45cf9f45828d380ceab10872e7ca2a08d (diff)
downloadchromium_src-a1c8bae3608e6c40f0258fbb780223cdae0b61d5.zip
chromium_src-a1c8bae3608e6c40f0258fbb780223cdae0b61d5.tar.gz
chromium_src-a1c8bae3608e6c40f0258fbb780223cdae0b61d5.tar.bz2
[InfoBar] Add InfoBarDelegate::GetIconID()
Splits apart the GetIcon() call to allow accessing the ID of the resource in addition to the loaded image. This is needed so that the Android port can determine which of the Java-side resources it needs to load for its UI. * GetIconID() is a function that gets overridden by subclasses instead of GetIcon(). GetIconID() returns the IDR_* tag that represents the icon that it would normally load. * GetIcon() now calls GetIconID() and shouldn't be overridden. * Small change to the SimpleAlertInfoBarDelegate::Create() call to account for invalid icon IDs (was NULL for bitmaps, 0 for non-existent icons). BUG=237034 Review URL: https://chromiumcodereview.appspot.com/15067008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200598 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/geolocation')
-rw-r--r--chrome/browser/geolocation/geolocation_browsertest.cc2
-rw-r--r--chrome/browser/geolocation/geolocation_infobar_delegate.cc6
-rw-r--r--chrome/browser/geolocation/geolocation_infobar_delegate.h2
3 files changed, 4 insertions, 6 deletions
diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc
index cdf566a..8b715c7 100644
--- a/chrome/browser/geolocation/geolocation_browsertest.cc
+++ b/chrome/browser/geolocation/geolocation_browsertest.cc
@@ -175,7 +175,7 @@ void GeolocationNotificationObserver::Observe(
const content::NotificationDetails& details) {
if (type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED) {
infobar_ = content::Details<InfoBarAddedDetails>(details).ptr();
- ASSERT_TRUE(infobar_->GetIcon());
+ ASSERT_FALSE(infobar_->GetIcon().IsEmpty());
ASSERT_TRUE(infobar_->AsConfirmInfoBarDelegate());
} else if (type == content::NOTIFICATION_DOM_OPERATION_RESPONSE) {
content::Details<DomOperationNotificationDetails> dom_op_details(details);
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.cc b/chrome/browser/geolocation/geolocation_infobar_delegate.cc
index 2b64fdfb..07caf8a 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate.cc
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate.cc
@@ -15,7 +15,6 @@
#include "grit/theme_resources.h"
#include "net/base/net_util.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
#if defined(OS_ANDROID)
#include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h"
@@ -65,9 +64,8 @@ void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting,
update_content_setting, allowed);
}
-gfx::Image* GeolocationInfoBarDelegate::GetIcon() const {
- return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
- IDR_GEOLOCATION_INFOBAR_ICON);
+int GeolocationInfoBarDelegate::GetIconID() const {
+ return IDR_GEOLOCATION_INFOBAR_ICON;
}
InfoBarDelegate::Type GeolocationInfoBarDelegate::GetInfoBarType() const {
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.h b/chrome/browser/geolocation/geolocation_infobar_delegate.h
index f39ab60..64e2f2b 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate.h
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate.h
@@ -42,7 +42,7 @@ class GeolocationInfoBarDelegate : public ConfirmInfoBarDelegate {
private:
// ConfirmInfoBarDelegate:
- virtual gfx::Image* GetIcon() const OVERRIDE;
+ virtual int GetIconID() const OVERRIDE;
virtual Type GetInfoBarType() const OVERRIDE;
virtual bool ShouldExpireInternal(
const content::LoadCommittedDetails& details) const OVERRIDE;