diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-16 23:17:40 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-16 23:17:40 +0000 |
commit | 279bb409e122fc5069dfc173c110565ade2ca9b8 (patch) | |
tree | 75beeeef6775d6bc9daff08f4d7d3192d8e306b5 | |
parent | 2788083f4674b0ba49c52d0df47a19f064d32b84 (diff) | |
download | chromium_src-279bb409e122fc5069dfc173c110565ade2ca9b8.zip chromium_src-279bb409e122fc5069dfc173c110565ade2ca9b8.tar.gz chromium_src-279bb409e122fc5069dfc173c110565ade2ca9b8.tar.bz2 |
GeolocationConfirmInfoBarDelegate* -> GeolocationInfoBarDelegate*, for consistency with other infobars and brevity.
BUG=none
TEST=none
Review URL: https://codereview.chromium.org/11785030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194478 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/geolocation/geolocation_infobar_delegate.cc (renamed from chrome/browser/geolocation/geolocation_confirm_infobar_delegate.cc) | 35 | ||||
-rw-r--r-- | chrome/browser/geolocation/geolocation_infobar_delegate.h (renamed from chrome/browser/geolocation/geolocation_confirm_infobar_delegate.h) | 21 | ||||
-rw-r--r-- | chrome/browser/geolocation/geolocation_infobar_delegate_android.cc (renamed from chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.cc) | 19 | ||||
-rw-r--r-- | chrome/browser/geolocation/geolocation_infobar_delegate_android.h (renamed from chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.h) | 15 | ||||
-rw-r--r-- | chrome/browser/geolocation/geolocation_infobar_queue_controller.cc | 7 | ||||
-rw-r--r-- | chrome/browser/geolocation/geolocation_infobar_queue_controller.h | 1 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 8 |
7 files changed, 49 insertions, 57 deletions
diff --git a/chrome/browser/geolocation/geolocation_confirm_infobar_delegate.cc b/chrome/browser/geolocation/geolocation_infobar_delegate.cc index e89965b..47cb102 100644 --- a/chrome/browser/geolocation/geolocation_confirm_infobar_delegate.cc +++ b/chrome/browser/geolocation/geolocation_infobar_delegate.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/geolocation/geolocation_confirm_infobar_delegate.h" +#include "chrome/browser/geolocation/geolocation_infobar_delegate.h" #include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h" #include "chrome/browser/google/google_util.h" @@ -18,15 +18,15 @@ #include "ui/base/resource/resource_bundle.h" #if defined(OS_ANDROID) -#include "chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.h" -typedef GeolocationConfirmInfoBarDelegateAndroid DelegateType; +#include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" +typedef GeolocationInfoBarDelegateAndroid DelegateType; #else -typedef GeolocationConfirmInfoBarDelegate DelegateType; +typedef GeolocationInfoBarDelegate DelegateType; #endif // static -InfoBarDelegate* GeolocationConfirmInfoBarDelegate::Create( +InfoBarDelegate* GeolocationInfoBarDelegate::Create( InfoBarService* infobar_service, GeolocationInfoBarQueueController* controller, const GeolocationPermissionRequestID& id, @@ -37,7 +37,7 @@ InfoBarDelegate* GeolocationConfirmInfoBarDelegate::Create( display_languages))); } -GeolocationConfirmInfoBarDelegate::GeolocationConfirmInfoBarDelegate( +GeolocationInfoBarDelegate::GeolocationInfoBarDelegate( InfoBarService* infobar_service, GeolocationInfoBarQueueController* controller, const GeolocationPermissionRequestID& id, @@ -53,17 +53,16 @@ GeolocationConfirmInfoBarDelegate::GeolocationConfirmInfoBarDelegate( contents_unique_id_ = committed_entry ? committed_entry->GetUniqueID() : 0; } -gfx::Image* GeolocationConfirmInfoBarDelegate::GetIcon() const { +gfx::Image* GeolocationInfoBarDelegate::GetIcon() const { return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_GEOLOCATION_INFOBAR_ICON); } -InfoBarDelegate::Type - GeolocationConfirmInfoBarDelegate::GetInfoBarType() const { +InfoBarDelegate::Type GeolocationInfoBarDelegate::GetInfoBarType() const { return PAGE_ACTION_TYPE; } -bool GeolocationConfirmInfoBarDelegate::ShouldExpireInternal( +bool GeolocationInfoBarDelegate::ShouldExpireInternal( const content::LoadCommittedDetails& details) const { // This implementation matches InfoBarDelegate::ShouldExpireInternal(), but // uses the unique ID we set in the constructor instead of that stored in the @@ -74,39 +73,39 @@ bool GeolocationConfirmInfoBarDelegate::ShouldExpireInternal( content::PAGE_TRANSITION_RELOAD); } -string16 GeolocationConfirmInfoBarDelegate::GetMessageText() const { +string16 GeolocationInfoBarDelegate::GetMessageText() const { return l10n_util::GetStringFUTF16(IDS_GEOLOCATION_INFOBAR_QUESTION, net::FormatUrl(requesting_frame_.GetOrigin(), display_languages_)); } -string16 GeolocationConfirmInfoBarDelegate::GetButtonLabel( +string16 GeolocationInfoBarDelegate::GetButtonLabel( InfoBarButton button) const { return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_GEOLOCATION_ALLOW_BUTTON : IDS_GEOLOCATION_DENY_BUTTON); } -void GeolocationConfirmInfoBarDelegate::SetPermission( - bool update_content_setting, bool allowed) { +void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting, + bool allowed) { controller_->OnPermissionSet(id_, requesting_frame_, owner()->GetWebContents()->GetURL(), update_content_setting, allowed); } -bool GeolocationConfirmInfoBarDelegate::Accept() { +bool GeolocationInfoBarDelegate::Accept() { SetPermission(true, true); return true; } -bool GeolocationConfirmInfoBarDelegate::Cancel() { +bool GeolocationInfoBarDelegate::Cancel() { SetPermission(true, false); return true; } -string16 GeolocationConfirmInfoBarDelegate::GetLinkText() const { +string16 GeolocationInfoBarDelegate::GetLinkText() const { return l10n_util::GetStringUTF16(IDS_LEARN_MORE); } -bool GeolocationConfirmInfoBarDelegate::LinkClicked( +bool GeolocationInfoBarDelegate::LinkClicked( WindowOpenDisposition disposition) { const char kGeolocationLearnMoreUrl[] = #if defined(OS_CHROMEOS) diff --git a/chrome/browser/geolocation/geolocation_confirm_infobar_delegate.h b/chrome/browser/geolocation/geolocation_infobar_delegate.h index d1edf78..be9f6ac 100644 --- a/chrome/browser/geolocation/geolocation_confirm_infobar_delegate.h +++ b/chrome/browser/geolocation/geolocation_infobar_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_CONFIRM_INFOBAR_DELEGATE_H_ -#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_CONFIRM_INFOBAR_DELEGATE_H_ +#ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_DELEGATE_H_ +#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_DELEGATE_H_ #include "chrome/browser/geolocation/geolocation_permission_request_id.h" #include "chrome/browser/infobars/confirm_infobar_delegate.h" @@ -17,7 +17,7 @@ class InfoBarService; // GeolocationInfoBarDelegates are created by the // GeolocationInfoBarQueueController to control the display // and handling of geolocation permission infobars to the user. -class GeolocationConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { +class GeolocationInfoBarDelegate : public ConfirmInfoBarDelegate { public: // Creates a geolocation delegate and adds it to |infobar_service|. Returns // the delegate if it was successfully added. @@ -28,12 +28,11 @@ class GeolocationConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { const std::string& display_languages); protected: - GeolocationConfirmInfoBarDelegate( - InfoBarService* infobar_service, - GeolocationInfoBarQueueController* controller, - const GeolocationPermissionRequestID& id, - const GURL& requesting_frame, - const std::string& display_languages); + GeolocationInfoBarDelegate(InfoBarService* infobar_service, + GeolocationInfoBarQueueController* controller, + const GeolocationPermissionRequestID& id, + const GURL& requesting_frame, + const std::string& display_languages); const GeolocationPermissionRequestID& id() const { return id_; } @@ -59,7 +58,7 @@ class GeolocationConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { int contents_unique_id_; std::string display_languages_; - DISALLOW_IMPLICIT_CONSTRUCTORS(GeolocationConfirmInfoBarDelegate); + DISALLOW_IMPLICIT_CONSTRUCTORS(GeolocationInfoBarDelegate); }; -#endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_CONFIRM_INFOBAR_DELEGATE_H_ +#endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_DELEGATE_H_ diff --git a/chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.cc b/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc index 2cc5989..d409720 100644 --- a/chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.cc +++ b/chrome/browser/geolocation/geolocation_infobar_delegate_android.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.h" +#include "chrome/browser/geolocation/geolocation_infobar_delegate_android.h" #include "base/utf_string_conversions.h" #include "chrome/browser/android/google_location_settings_helper.h" @@ -11,29 +11,26 @@ #include "grit/theme_resources.h" #include "ui/base/l10n/l10n_util.h" -GeolocationConfirmInfoBarDelegateAndroid:: - GeolocationConfirmInfoBarDelegateAndroid( +GeolocationInfoBarDelegateAndroid::GeolocationInfoBarDelegateAndroid( InfoBarService* infobar_service, GeolocationInfoBarQueueController* controller, const GeolocationPermissionRequestID& id, const GURL& requesting_frame_url, const std::string& display_languages) - : GeolocationConfirmInfoBarDelegate(infobar_service, controller, id, - requesting_frame_url, - display_languages), + : GeolocationInfoBarDelegate(infobar_service, controller, id, + requesting_frame_url, display_languages), google_location_settings_helper_( GoogleLocationSettingsHelper::Create()) { } -GeolocationConfirmInfoBarDelegateAndroid:: - ~GeolocationConfirmInfoBarDelegateAndroid() { +GeolocationInfoBarDelegateAndroid::~GeolocationInfoBarDelegateAndroid() { } -bool GeolocationConfirmInfoBarDelegateAndroid::Accept() { +bool GeolocationInfoBarDelegateAndroid::Accept() { // Accept button text could be either 'Allow' or 'Google Location Settings'. // If 'Allow' we follow the regular flow. if (google_location_settings_helper_->IsGoogleAppsLocationSettingEnabled()) - return GeolocationConfirmInfoBarDelegate::Accept(); + return GeolocationInfoBarDelegate::Accept(); // If 'Google Location Settings', we need to open the system Google Location // Settings activity. @@ -42,7 +39,7 @@ bool GeolocationConfirmInfoBarDelegateAndroid::Accept() { return true; } -string16 GeolocationConfirmInfoBarDelegateAndroid::GetButtonLabel( +string16 GeolocationInfoBarDelegateAndroid::GetButtonLabel( InfoBarButton button) const { if (button == BUTTON_OK) { return UTF8ToUTF16( diff --git a/chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.h b/chrome/browser/geolocation/geolocation_infobar_delegate_android.h index 8024cfa..92f4f51 100644 --- a/chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.h +++ b/chrome/browser/geolocation/geolocation_infobar_delegate_android.h @@ -2,24 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_CONFIRM_INFOBAR_DELEGATE_ANDROID_H_ -#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_CONFIRM_INFOBAR_DELEGATE_ANDROID_H_ +#ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_DELEGATE_ANDROID_H_ +#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_DELEGATE_ANDROID_H_ #include "base/memory/scoped_ptr.h" -#include "chrome/browser/geolocation/geolocation_confirm_infobar_delegate.h" +#include "chrome/browser/geolocation/geolocation_infobar_delegate.h" class GoogleLocationSettingsHelper; -class GeolocationConfirmInfoBarDelegateAndroid - : public GeolocationConfirmInfoBarDelegate { +class GeolocationInfoBarDelegateAndroid: public GeolocationInfoBarDelegate { public: - GeolocationConfirmInfoBarDelegateAndroid( + GeolocationInfoBarDelegateAndroid( InfoBarService* infobar_service, GeolocationInfoBarQueueController* controller, const GeolocationPermissionRequestID& id, const GURL& requesting_frame_url, const std::string& display_languages); - virtual ~GeolocationConfirmInfoBarDelegateAndroid(); + virtual ~GeolocationInfoBarDelegateAndroid(); private: // ConfirmInfoBarDelegate: @@ -30,4 +29,4 @@ class GeolocationConfirmInfoBarDelegateAndroid }; -#endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_CONFIRM_INFOBAR_DELEGATE_ANDROID_H_ +#endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_INFOBAR_DELEGATE_ANDROID_H_ diff --git a/chrome/browser/geolocation/geolocation_infobar_queue_controller.cc b/chrome/browser/geolocation/geolocation_infobar_queue_controller.cc index 6bc3fc5..2721472 100644 --- a/chrome/browser/geolocation/geolocation_infobar_queue_controller.cc +++ b/chrome/browser/geolocation/geolocation_infobar_queue_controller.cc @@ -6,7 +6,7 @@ #include "base/prefs/pref_service.h" #include "chrome/browser/content_settings/host_content_settings_map.h" -#include "chrome/browser/geolocation/geolocation_confirm_infobar_delegate.h" +#include "chrome/browser/geolocation/geolocation_infobar_delegate.h" #include "chrome/browser/infobars/infobar.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/profiles/profile.h" @@ -96,7 +96,7 @@ void GeolocationInfoBarQueueController::PendingInfoBarRequest::RunCallback( void GeolocationInfoBarQueueController::PendingInfoBarRequest:: CreateInfoBarDelegate(GeolocationInfoBarQueueController* controller, const std::string& display_languages) { - infobar_delegate_ = GeolocationConfirmInfoBarDelegate::Create( + infobar_delegate_ = GeolocationInfoBarDelegate::Create( GetInfoBarService(id_), controller, id_, requesting_frame_, display_languages); @@ -216,8 +216,7 @@ void GeolocationInfoBarQueueController::Observe( content::Details<InfoBarRemovedDetails>(details)->first; for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin(); i != pending_infobar_requests_.end(); ++i) { - InfoBarDelegate* confirm_delegate = i->infobar_delegate(); - if (confirm_delegate == delegate) { + if (i->infobar_delegate() == delegate) { GeolocationPermissionRequestID id(i->id()); pending_infobar_requests_.erase(i); ShowQueuedInfoBarForTab(id); diff --git a/chrome/browser/geolocation/geolocation_infobar_queue_controller.h b/chrome/browser/geolocation/geolocation_infobar_queue_controller.h index 0f40922..6cc1823 100644 --- a/chrome/browser/geolocation/geolocation_infobar_queue_controller.h +++ b/chrome/browser/geolocation/geolocation_infobar_queue_controller.h @@ -10,7 +10,6 @@ #include "content/public/browser/notification_registrar.h" class GURL; -class GeolocationConfirmInfoBarDelegate; class GeolocationPermissionRequestID; class InfoBarService; class Profile; diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index c4f59f1..cda5d6c 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -542,10 +542,10 @@ 'browser/geolocation/chrome_geolocation_permission_context_android.h', 'browser/geolocation/chrome_geolocation_permission_context_factory.cc', 'browser/geolocation/chrome_geolocation_permission_context_factory.h', - 'browser/geolocation/geolocation_confirm_infobar_delegate.cc', - 'browser/geolocation/geolocation_confirm_infobar_delegate.h', - 'browser/geolocation/geolocation_confirm_infobar_delegate_android.cc', - 'browser/geolocation/geolocation_confirm_infobar_delegate_android.h', + 'browser/geolocation/geolocation_infobar_delegate.cc', + 'browser/geolocation/geolocation_infobar_delegate.h', + 'browser/geolocation/geolocation_infobar_delegate_android.cc', + 'browser/geolocation/geolocation_infobar_delegate_android.h', 'browser/geolocation/geolocation_infobar_queue_controller.cc', 'browser/geolocation/geolocation_infobar_queue_controller.h', 'browser/geolocation/geolocation_permission_request_id.cc', |