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

Unified Diff: chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.cc

Issue 11186010: Update geolocation infobar to handle Android system settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix conflict Created 8 years, 2 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
Index: chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.cc
diff --git a/chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.cc b/chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.cc
index e440320278e69aa38ebb5ed913c60684e14c4e8a..ff7e6e7bd62f6c6985e49bb8f68944ef20338b29 100644
--- a/chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.cc
+++ b/chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/android/google_location_settings_helper.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
#include "grit/theme_resources.h"
@@ -12,6 +13,7 @@
GeolocationConfirmInfoBarDelegateAndroid::
GeolocationConfirmInfoBarDelegateAndroid(
+ GoogleLocationSettingsHelper* google_location_settings_helper,
InfoBarTabHelper* infobar_helper,
GeolocationInfoBarQueueController* controller,
int render_process_id,
@@ -25,15 +27,29 @@ GeolocationConfirmInfoBarDelegateAndroid(
render_view_id,
bridge_id,
requesting_frame_url,
- display_languages) {
+ display_languages),
+ google_location_settings_helper_(google_location_settings_helper) {
}
bool GeolocationConfirmInfoBarDelegateAndroid::Accept() {
- return GeolocationConfirmInfoBarDelegate::Accept();
+ // Accept button text could be either 'Allow' or 'Google Location Settings'.
John Knottenbelt 2012/10/17 10:28:29 Please update this comment - have you got it that
Ramya 2012/10/22 23:57:11 Yes, this works in the legacy case as well.
+ // If 'Allow' we follow the regular flow.
+ if (google_location_settings_helper_->IsPlatformSettingEnabled())
+ return GeolocationConfirmInfoBarDelegate::Accept();
+
+ // If 'Google Location Settings', we need to open the system Google Location
+ // Settings activity.
+ google_location_settings_helper_->ShowGoogleLocationSettings();
+ SetPermission(false, false);
+ return true;
}
string16 GeolocationConfirmInfoBarDelegateAndroid::GetButtonLabel(
InfoBarButton button) const {
- return l10n_util::GetStringUTF16((button == BUTTON_OK) ?
- IDS_GEOLOCATION_ALLOW_BUTTON : IDS_GEOLOCATION_DENY_BUTTON);
+ string16 button_ok_text;
+ if (button == BUTTON_OK) {
+ return UTF8ToUTF16(
+ google_location_settings_helper_->GetAcceptButtonLabel());
+ }
+ return l10n_util::GetStringUTF16(IDS_GEOLOCATION_DENY_BUTTON);
}

Powered by Google App Engine
This is Rietveld 408576698