diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-02 21:41:34 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-02 21:41:34 +0000 |
commit | c31f84b5853f9584545c26bd1eca0e588616cf7d (patch) | |
tree | f2eb34d4dfeecfdf855b039c8d67606055b97c5c /chrome/browser/geolocation | |
parent | be0a2cfd5ff6d24015c34334250515235e7e8638 (diff) | |
download | chromium_src-c31f84b5853f9584545c26bd1eca0e588616cf7d.zip chromium_src-c31f84b5853f9584545c26bd1eca0e588616cf7d.tar.gz chromium_src-c31f84b5853f9584545c26bd1eca0e588616cf7d.tar.bz2 |
Change InfoBar-related notifications to be sourced from a TabContentsWrapper, not a TabContents. Also change the notifications' Details to be more like what they will ultimately become once TCW owns the InfoBars, by adding a bool to the REMOVED notification for animation state, and changing the "add"-related args from InfoBarDelegate* to InfoBar*. (I can't yet change the removed infobar delegate args similarly because TabContentsWrapper current has no way to map back from an InfoBarDelegate* to a corresponding Infobar*.)
BUG=62154
TEST=none
Review URL: http://codereview.chromium.org/7006010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/geolocation')
-rw-r--r-- | chrome/browser/geolocation/geolocation_browsertest.cc | 3 | ||||
-rw-r--r-- | chrome/browser/geolocation/geolocation_permission_context_unittest.cc | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc index 9113372..39dc55b 100644 --- a/chrome/browser/geolocation/geolocation_browsertest.cc +++ b/chrome/browser/geolocation/geolocation_browsertest.cc @@ -12,6 +12,7 @@ #include "chrome/browser/geolocation/geolocation_settings_state.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" +#include "chrome/browser/tab_contents/infobar.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" @@ -150,7 +151,7 @@ class GeolocationNotificationObserver : public NotificationObserver { const NotificationSource& source, const NotificationDetails& details) { if (type.value == NotificationType::TAB_CONTENTS_INFOBAR_ADDED) { - infobar_ = Details<InfoBarDelegate>(details).ptr(); + infobar_ = Details<InfoBar>(details).ptr()->delegate(); ASSERT_TRUE(infobar_->GetIcon()); ASSERT_TRUE(infobar_->AsConfirmInfoBarDelegate()); } else if (type == NotificationType::DOM_OPERATION_RESPONSE) { diff --git a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc index ab73d24..dd6a395 100644 --- a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc +++ b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc @@ -51,7 +51,7 @@ TestTabContentsWithPendingInfoBar::TestTabContentsWithPendingInfoBar( : TabContentsWrapper( new TabContents(profile, instance, MSG_ROUTING_NONE, NULL, NULL)), removed_infobar_delegate_(NULL) { - Source<TabContents> source(tab_contents()); + Source<TabContentsWrapper> source(this); registrar_.Add(this, NotificationType::TAB_CONTENTS_INFOBAR_REMOVED, source); } @@ -63,10 +63,12 @@ void TestTabContentsWithPendingInfoBar::Observe( NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - if (type.value == NotificationType::TAB_CONTENTS_INFOBAR_REMOVED) - removed_infobar_delegate_ = Details<InfoBarDelegate>(details).ptr(); - else + if (type.value == NotificationType::TAB_CONTENTS_INFOBAR_REMOVED) { + removed_infobar_delegate_ = + Details<std::pair<InfoBarDelegate*, bool> >(details)->first; + } else { TabContentsWrapper::Observe(type, source, details); + } } } // namespace |