diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 19:01:19 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 19:01:19 +0000 |
commit | f4f50efb4d3ee42470c8057345e902ac42e76801 (patch) | |
tree | 5b4d0c57cd94d8169db9dc441f424d6443e4f490 /chrome/browser/geolocation | |
parent | 0bd22cab9c919ff8d9b35153f6799dc031fe2770 (diff) | |
download | chromium_src-f4f50efb4d3ee42470c8057345e902ac42e76801.zip chromium_src-f4f50efb4d3ee42470c8057345e902ac42e76801.tar.gz chromium_src-f4f50efb4d3ee42470c8057345e902ac42e76801.tar.bz2 |
Cleanup: de-inline a bunch of classes, rename and move "PluginInstaller" to "PluginInstallerInfoBarDelegate" for clarity, lots of other misc. stuff
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6249010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72166 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/geolocation')
-rw-r--r-- | chrome/browser/geolocation/geolocation_permission_context.cc | 327 | ||||
-rw-r--r-- | chrome/browser/geolocation/geolocation_permission_context_unittest.cc | 26 |
2 files changed, 197 insertions, 156 deletions
diff --git a/chrome/browser/geolocation/geolocation_permission_context.cc b/chrome/browser/geolocation/geolocation_permission_context.cc index fa07261..04c9c6e5 100644 --- a/chrome/browser/geolocation/geolocation_permission_context.cc +++ b/chrome/browser/geolocation/geolocation_permission_context.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -34,16 +34,7 @@ #include "net/base/net_util.h" #include "ui/base/resource/resource_bundle.h" -namespace { - -const char kGeolocationLearnMoreUrl[] = -#if defined(OS_CHROMEOS) - "http://www.google.com/support/chromeos/bin/answer.py?answer=142065"; -#else - "http://www.google.com/support/chrome/bin/answer.py?answer=142065"; -#endif - -} // namespace +// GeolocationInfoBarQueueController ------------------------------------------ // This class controls the geolocation infobar queue per profile, and it's an // internal class to GeolocationPermissionContext. @@ -62,25 +53,32 @@ class GeolocationInfoBarQueueController : NotificationObserver { // The InfoBar will be displayed immediately if the tab is not already // displaying one, otherwise it'll be queued. - void CreateInfoBarRequest( - int render_process_id, int render_view_id, int bridge_id, - const GURL& requesting_frame, const GURL& emebedder); + void CreateInfoBarRequest(int render_process_id, + int render_view_id, + int bridge_id, + const GURL& requesting_frame, + const GURL& emebedder); // Cancels a specific infobar request. - void CancelInfoBarRequest( - int render_process_id, int render_view_id, int bridge_id); + void CancelInfoBarRequest(int render_process_id, + int render_view_id, + int bridge_id); // Called by the InfoBarDelegate to notify it's closed. It'll display a new // InfoBar if there's any request pending for this tab. - void OnInfoBarClosed( - int render_process_id, int render_view_id, int bridge_id); + void OnInfoBarClosed(int render_process_id, + int render_view_id, + int bridge_id); // Called by the InfoBarDelegate to notify permission has been set. // It'll notify and dismiss any other pending InfoBar request for the same // |requesting_frame| and embedder. - void OnPermissionSet( - int render_process_id, int render_view_id, int bridge_id, - const GURL& requesting_frame, const GURL& embedder, bool allowed); + void OnPermissionSet(int render_process_id, + int render_view_id, + int bridge_id, + const GURL& requesting_frame, + const GURL& embedder, + bool allowed); // NotificationObserver virtual void Observe(NotificationType type, @@ -108,74 +106,41 @@ class GeolocationInfoBarQueueController : NotificationObserver { namespace { -// This is the delegate used to display the confirmation info bar. +const char kGeolocationLearnMoreUrl[] = +#if defined(OS_CHROMEOS) + "http://www.google.com/support/chromeos/bin/answer.py?answer=142065"; +#else + "http://www.google.com/support/chrome/bin/answer.py?answer=142065"; +#endif + + +// GeolocationConfirmInfoBarDelegate ------------------------------------------ + class GeolocationConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { public: GeolocationConfirmInfoBarDelegate( - TabContents* tab_contents, GeolocationInfoBarQueueController* controller, - int render_process_id, int render_view_id, int bridge_id, + TabContents* tab_contents, + GeolocationInfoBarQueueController* controller, + int render_process_id, + int render_view_id, + int bridge_id, const GURL& requesting_frame_url, - const std::string& display_languages) - : ConfirmInfoBarDelegate(tab_contents), - tab_contents_(tab_contents), - controller_(controller), - render_process_id_(render_process_id), - render_view_id_(render_view_id), - bridge_id_(bridge_id), - requesting_frame_url_(requesting_frame_url), - display_languages_(display_languages) { - } - - // ConfirmInfoBarDelegate - virtual void InfoBarClosed() { - controller_->OnInfoBarClosed(render_process_id_, render_view_id_, - bridge_id_); - delete this; - } - virtual Type GetInfoBarType() { return PAGE_ACTION_TYPE; } - virtual bool Accept() { return OnPermissionSet(true); } - virtual bool Cancel() { return OnPermissionSet(false); } - virtual int GetButtons() const { return BUTTON_OK | BUTTON_CANCEL; } - virtual string16 GetButtonLabel(InfoBarButton button) const { - switch (button) { - case BUTTON_OK: - return l10n_util::GetStringUTF16(IDS_GEOLOCATION_ALLOW_BUTTON); - case BUTTON_CANCEL: - return l10n_util::GetStringUTF16(IDS_GEOLOCATION_DENY_BUTTON); - default: - // All buttons are labeled above. - NOTREACHED() << "Bad button id " << button; - return string16(); - } - } - virtual string16 GetMessageText() const { - return l10n_util::GetStringFUTF16( - IDS_GEOLOCATION_INFOBAR_QUESTION, - net::FormatUrl(requesting_frame_url_.GetOrigin(), display_languages_)); - } - virtual SkBitmap* GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( - IDR_GEOLOCATION_INFOBAR_ICON); - } - virtual string16 GetLinkText() { - return l10n_util::GetStringUTF16(IDS_LEARN_MORE); - } - virtual bool LinkClicked(WindowOpenDisposition disposition) { - GURL learn_more_url = - google_util::AppendGoogleLocaleParam(GURL(kGeolocationLearnMoreUrl)); - // Ignore the click disposition and always open in a new top level tab. - tab_contents_->OpenURL( - learn_more_url, GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); - return false; // Do not dismiss the info bar. - } + const std::string& display_languages); private: - bool OnPermissionSet(bool confirm) { - controller_->OnPermissionSet( - render_process_id_, render_view_id_, bridge_id_, requesting_frame_url_, - tab_contents_->GetURL(), confirm); - return true; - } + virtual ~GeolocationConfirmInfoBarDelegate(); + + // ConfirmInfoBarDelegate: + virtual void InfoBarClosed(); + virtual SkBitmap* GetIcon() const; + virtual Type GetInfoBarType() const; + virtual string16 GetMessageText() const; + virtual int GetButtons() const; + virtual string16 GetButtonLabel(InfoBarButton button) const; + virtual bool Accept(); + virtual bool Cancel(); + virtual string16 GetLinkText(); + virtual bool LinkClicked(WindowOpenDisposition disposition); TabContents* tab_contents_; GeolocationInfoBarQueueController* controller_; @@ -188,8 +153,88 @@ class GeolocationConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { DISALLOW_IMPLICIT_CONSTRUCTORS(GeolocationConfirmInfoBarDelegate); }; +GeolocationConfirmInfoBarDelegate::GeolocationConfirmInfoBarDelegate( + TabContents* tab_contents, + GeolocationInfoBarQueueController* controller, + int render_process_id, + int render_view_id, + int bridge_id, + const GURL& requesting_frame_url, + const std::string& display_languages) + : ConfirmInfoBarDelegate(tab_contents), + tab_contents_(tab_contents), + controller_(controller), + render_process_id_(render_process_id), + render_view_id_(render_view_id), + bridge_id_(bridge_id), + requesting_frame_url_(requesting_frame_url), + display_languages_(display_languages) { +} + +GeolocationConfirmInfoBarDelegate::~GeolocationConfirmInfoBarDelegate() { +} + +void GeolocationConfirmInfoBarDelegate::InfoBarClosed() { + controller_->OnInfoBarClosed(render_process_id_, render_view_id_, + bridge_id_); + delete this; +} + +SkBitmap* GeolocationConfirmInfoBarDelegate::GetIcon() const { + return ResourceBundle::GetSharedInstance().GetBitmapNamed( + IDR_GEOLOCATION_INFOBAR_ICON); +} + +InfoBarDelegate::Type + GeolocationConfirmInfoBarDelegate::GetInfoBarType() const { + return PAGE_ACTION_TYPE; +} + +string16 GeolocationConfirmInfoBarDelegate::GetMessageText() const { + return l10n_util::GetStringFUTF16(IDS_GEOLOCATION_INFOBAR_QUESTION, + net::FormatUrl(requesting_frame_url_.GetOrigin(), display_languages_)); +} + +int GeolocationConfirmInfoBarDelegate::GetButtons() const { + return BUTTON_OK | BUTTON_CANCEL; +} + +string16 GeolocationConfirmInfoBarDelegate::GetButtonLabel( + InfoBarButton button) const { + return l10n_util::GetStringUTF16((button == BUTTON_OK) ? + IDS_GEOLOCATION_ALLOW_BUTTON : IDS_GEOLOCATION_DENY_BUTTON); +} + +bool GeolocationConfirmInfoBarDelegate::Accept() { + controller_->OnPermissionSet(render_process_id_, render_view_id_, bridge_id_, + requesting_frame_url_, tab_contents_->GetURL(), true); + return true; +} + +bool GeolocationConfirmInfoBarDelegate::Cancel() { + controller_->OnPermissionSet(render_process_id_, render_view_id_, bridge_id_, + requesting_frame_url_, tab_contents_->GetURL(), false); + return true; +} + +string16 GeolocationConfirmInfoBarDelegate::GetLinkText() { + return l10n_util::GetStringUTF16(IDS_LEARN_MORE); +} + +bool GeolocationConfirmInfoBarDelegate::LinkClicked( + WindowOpenDisposition disposition) { + // Ignore the click disposition and always open in a new top level tab. + tab_contents_->OpenURL( + google_util::AppendGoogleLocaleParam(GURL(kGeolocationLearnMoreUrl)), + GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); + return false; // Do not dismiss the info bar. +} + } // namespace + +// GeolocationInfoBarQueueController ------------------------------------------ + struct GeolocationInfoBarQueueController::PendingInfoBarRequest { int render_process_id; int render_view_id; @@ -228,8 +273,11 @@ GeolocationInfoBarQueueController::~GeolocationInfoBarQueueController() { } void GeolocationInfoBarQueueController::CreateInfoBarRequest( - int render_process_id, int render_view_id, int bridge_id, - const GURL& requesting_frame, const GURL& embedder) { + int render_process_id, + int render_view_id, + int bridge_id, + const GURL& requesting_frame, + const GURL& embedder) { // This makes sure that no duplicates are added to // |pending_infobar_requests_| as an artificial permission request may // already exist in the queue as per @@ -238,14 +286,13 @@ void GeolocationInfoBarQueueController::CreateInfoBarRequest( // TODO(joth): Once we have CLIENT_BASED_GEOLOCATION and // WTF_USE_PREEMPT_GEOLOCATION_PERMISSION set in WebKit we should be able to // just use a DCHECK to check if a duplicate is attempting to be added. - PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin(); - while (i != pending_infobar_requests_.end()) { + for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin(); + i != pending_infobar_requests_.end(); ++i) { if (i->Equals(render_process_id, render_view_id, bridge_id)) { // The request already exists. DCHECK(i->IsForPair(requesting_frame, embedder)); return; } - ++i; } PendingInfoBarRequest pending_infobar_request; pending_infobar_request.render_process_id = render_process_id; @@ -259,18 +306,21 @@ void GeolocationInfoBarQueueController::CreateInfoBarRequest( } void GeolocationInfoBarQueueController::CancelInfoBarRequest( - int render_process_id, int render_view_id, int bridge_id) { + int render_process_id, + int render_view_id, + int bridge_id) { for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin(); i != pending_infobar_requests_.end(); ++i) { if (i->Equals(render_process_id, render_view_id, bridge_id)) { CancelInfoBarRequestInternal(i); - break; + return; } } } -void GeolocationInfoBarQueueController::OnInfoBarClosed( - int render_process_id, int render_view_id, int bridge_id) { +void GeolocationInfoBarQueueController::OnInfoBarClosed(int render_process_id, + int render_view_id, + int bridge_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin(); i != pending_infobar_requests_.end(); ++i) { @@ -283,8 +333,12 @@ void GeolocationInfoBarQueueController::OnInfoBarClosed( } void GeolocationInfoBarQueueController::OnPermissionSet( - int render_process_id, int render_view_id, int bridge_id, - const GURL& requesting_frame, const GURL& embedder, bool allowed) { + int render_process_id, + int render_view_id, + int bridge_id, + const GURL& requesting_frame, + const GURL& embedder, + bool allowed) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Persist the permission. ContentSetting content_setting = @@ -306,11 +360,11 @@ void GeolocationInfoBarQueueController::OnPermissionSet( // Cancel it first, and then notify the permission. // Note: if the pending request had an infobar, TabContents will // eventually close it and we will pump the queue via OnInfoBarClosed(). - PendingInfoBarRequest other_request = *i; + PendingInfoBarRequest copied_request = *i; i = CancelInfoBarRequestInternal(i); geolocation_permission_context_->NotifyPermissionSet( - other_request.render_process_id, other_request.render_view_id, - other_request.bridge_id, other_request.requesting_frame, allowed); + copied_request.render_process_id, copied_request.render_view_id, + copied_request.bridge_id, copied_request.requesting_frame, allowed); } else { ++i; } @@ -335,8 +389,8 @@ void GeolocationInfoBarQueueController::Observe( } } -void GeolocationInfoBarQueueController::ShowQueuedInfoBar( - int render_process_id, int render_view_id) { +void GeolocationInfoBarQueueController::ShowQueuedInfoBar(int render_process_id, + int render_view_id) { TabContents* tab_contents = tab_util::GetTabContentsByID(render_process_id, render_view_id); for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin(); @@ -352,17 +406,14 @@ void GeolocationInfoBarQueueController::ShowQueuedInfoBar( // Check if already displayed. if (i->infobar_delegate) break; - if (!registrar_.IsRegistered( - this, NotificationType::TAB_CONTENTS_DESTROYED, + if (!registrar_.IsRegistered(this, NotificationType::TAB_CONTENTS_DESTROYED, Source<TabContents>(tab_contents))) { - registrar_.Add( - this, NotificationType::TAB_CONTENTS_DESTROYED, + registrar_.Add(this, NotificationType::TAB_CONTENTS_DESTROYED, Source<TabContents>(tab_contents)); } - i->infobar_delegate = new GeolocationConfirmInfoBarDelegate( - tab_contents, this, - render_process_id, render_view_id, - i->bridge_id, i->requesting_frame, + i->infobar_delegate = new GeolocationConfirmInfoBarDelegate(tab_contents, + this, render_process_id, render_view_id, i->bridge_id, + i->requesting_frame, profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)); tab_contents->AddInfoBar(i->infobar_delegate); break; @@ -388,9 +439,8 @@ std::vector<GeolocationInfoBarQueueController::PendingInfoBarRequest>::iterator GeolocationPermissionContext::GeolocationPermissionContext( Profile* profile) : profile_(profile), - ALLOW_THIS_IN_INITIALIZER_LIST( - geolocation_infobar_queue_controller_( - new GeolocationInfoBarQueueController(this, profile))) { + ALLOW_THIS_IN_INITIALIZER_LIST(geolocation_infobar_queue_controller_( + new GeolocationInfoBarQueueController(this, profile))) { } GeolocationPermissionContext::~GeolocationPermissionContext() { @@ -400,11 +450,9 @@ void GeolocationPermissionContext::RequestGeolocationPermission( int render_process_id, int render_view_id, int bridge_id, const GURL& requesting_frame) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - NewRunnableMethod(this, - &GeolocationPermissionContext::RequestGeolocationPermission, - render_process_id, render_view_id, bridge_id, requesting_frame)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod( + this, &GeolocationPermissionContext::RequestGeolocationPermission, + render_process_id, render_view_id, bridge_id, requesting_frame)); return; } DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -430,8 +478,8 @@ void GeolocationPermissionContext::RequestGeolocationPermission( if (!tab_contents) { // The tab may have gone away, or the request may not be from a tab at all. LOG(WARNING) << "Attempt to use geolocation tabless renderer: " - << render_process_id << "," << render_view_id << "," << bridge_id - << " (can't prompt user without a visible tab)"; + << render_process_id << "," << render_view_id << "," + << bridge_id << " (can't prompt user without a visible tab)"; NotifyPermissionSet(render_process_id, render_view_id, bridge_id, requesting_frame, false); return; @@ -440,8 +488,8 @@ void GeolocationPermissionContext::RequestGeolocationPermission( GURL embedder = tab_contents->GetURL(); if (!requesting_frame.is_valid() || !embedder.is_valid()) { LOG(WARNING) << "Attempt to use geolocation from an invalid URL: " - << requesting_frame << "," << embedder - << " (geolocation is not supported in popups)"; + << requesting_frame << "," << embedder + << " (geolocation is not supported in popups)"; NotifyPermissionSet(render_process_id, render_view_id, bridge_id, requesting_frame, false); return; @@ -464,14 +512,19 @@ void GeolocationPermissionContext::RequestGeolocationPermission( } void GeolocationPermissionContext::CancelGeolocationPermissionRequest( - int render_process_id, int render_view_id, int bridge_id, + int render_process_id, + int render_view_id, + int bridge_id, const GURL& requesting_frame) { CancelPendingInfoBarRequest(render_process_id, render_view_id, bridge_id); } void GeolocationPermissionContext::NotifyPermissionSet( - int render_process_id, int render_view_id, int bridge_id, - const GURL& requesting_frame, bool allowed) { + int render_process_id, + int render_view_id, + int bridge_id, + const GURL& requesting_frame, + bool allowed) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); TabContents* tab_contents = @@ -485,17 +538,13 @@ void GeolocationPermissionContext::NotifyPermissionSet( allowed); } - CallRenderViewHost( - render_process_id, render_view_id, - &RenderViewHost::Send, + CallRenderViewHost(render_process_id, render_view_id, &RenderViewHost::Send, new ViewMsg_Geolocation_PermissionSet(render_view_id, bridge_id, - allowed)); + allowed)); if (allowed) { - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - NewRunnableMethod(this, - &GeolocationPermissionContext::NotifyArbitratorPermissionGranted, - requesting_frame)); + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, NewRunnableMethod( + this, &GeolocationPermissionContext::NotifyArbitratorPermissionGranted, + requesting_frame)); } } @@ -506,16 +555,16 @@ void GeolocationPermissionContext::NotifyArbitratorPermissionGranted( } void GeolocationPermissionContext::CancelPendingInfoBarRequest( - int render_process_id, int render_view_id, int bridge_id) { + int render_process_id, + int render_view_id, + int bridge_id) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - NewRunnableMethod(this, - &GeolocationPermissionContext::CancelPendingInfoBarRequest, - render_process_id, render_view_id, bridge_id)); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod( + this, &GeolocationPermissionContext::CancelPendingInfoBarRequest, + render_process_id, render_view_id, bridge_id)); return; } DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - geolocation_infobar_queue_controller_->CancelInfoBarRequest( - render_process_id, render_view_id, bridge_id); + geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id, + render_view_id, bridge_id); } diff --git a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc index c6e748b..f0346f4 100644 --- a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc +++ b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -168,12 +168,10 @@ TEST_F(GeolocationPermissionContextTests, SinglePermission) { TEST_F(GeolocationPermissionContextTests, QueuedPermission) { GURL requesting_frame_0("http://www.example.com/geolocation"); GURL requesting_frame_1("http://www.example-2.com/geolocation"); - EXPECT_EQ( - CONTENT_SETTING_ASK, + EXPECT_EQ(CONTENT_SETTING_ASK, profile()->GetGeolocationContentSettingsMap()->GetContentSetting( requesting_frame_0, requesting_frame_0)); - EXPECT_EQ( - CONTENT_SETTING_ASK, + EXPECT_EQ(CONTENT_SETTING_ASK, profile()->GetGeolocationContentSettingsMap()->GetContentSetting( requesting_frame_1, requesting_frame_0)); @@ -219,12 +217,10 @@ TEST_F(GeolocationPermissionContextTests, QueuedPermission) { infobar_1->InfoBarClosed(); EXPECT_EQ(0, contents()->infobar_delegate_count()); // Ensure the persisted permissions are ok. - EXPECT_EQ( - CONTENT_SETTING_ALLOW, + EXPECT_EQ(CONTENT_SETTING_ALLOW, profile()->GetGeolocationContentSettingsMap()->GetContentSetting( requesting_frame_0, requesting_frame_0)); - EXPECT_EQ( - CONTENT_SETTING_BLOCK, + EXPECT_EQ(CONTENT_SETTING_BLOCK, profile()->GetGeolocationContentSettingsMap()->GetContentSetting( requesting_frame_1, requesting_frame_0)); } @@ -232,12 +228,10 @@ TEST_F(GeolocationPermissionContextTests, QueuedPermission) { TEST_F(GeolocationPermissionContextTests, CancelGeolocationPermissionRequest) { GURL requesting_frame_0("http://www.example.com/geolocation"); GURL requesting_frame_1("http://www.example-2.com/geolocation"); - EXPECT_EQ( - CONTENT_SETTING_ASK, + EXPECT_EQ(CONTENT_SETTING_ASK, profile()->GetGeolocationContentSettingsMap()->GetContentSetting( requesting_frame_0, requesting_frame_0)); - EXPECT_EQ( - CONTENT_SETTING_ASK, + EXPECT_EQ(CONTENT_SETTING_ASK, profile()->GetGeolocationContentSettingsMap()->GetContentSetting( requesting_frame_1, requesting_frame_0)); @@ -280,12 +274,10 @@ TEST_F(GeolocationPermissionContextTests, CancelGeolocationPermissionRequest) { infobar_1->InfoBarClosed(); EXPECT_EQ(0, contents()->infobar_delegate_count()); // Ensure the persisted permissions are ok. - EXPECT_EQ( - CONTENT_SETTING_ASK, + EXPECT_EQ(CONTENT_SETTING_ASK, profile()->GetGeolocationContentSettingsMap()->GetContentSetting( requesting_frame_0, requesting_frame_0)); - EXPECT_EQ( - CONTENT_SETTING_ALLOW, + EXPECT_EQ(CONTENT_SETTING_ALLOW, profile()->GetGeolocationContentSettingsMap()->GetContentSetting( requesting_frame_1, requesting_frame_0)); } |