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

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: Failed to upload 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 6581abcaff87074d0661496389bbd0097da85c88..9b8e195f15413ff86a5c4ea43b713bcc24c73d4d 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"
@@ -25,11 +26,32 @@ GeolocationConfirmInfoBarDelegateAndroid(
render_view_id,
bridge_id,
requesting_frame_url,
- display_languages) {
+ display_languages),
+ google_location_settings_helper_(new GoogleLocationSettingsHelper()) {
+}
+
+GeolocationConfirmInfoBarDelegateAndroid::
+ ~GeolocationConfirmInfoBarDelegateAndroid() {
+}
+
+bool GeolocationConfirmInfoBarDelegateAndroid::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();
+
+ // 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);
+ if (button == BUTTON_OK) {
+ return UTF8ToUTF16(
+ google_location_settings_helper_->GetAcceptButtonLabel());
+ }
+ return l10n_util::GetStringUTF16(IDS_GEOLOCATION_DENY_BUTTON);
}
« no previous file with comments | « chrome/browser/geolocation/geolocation_confirm_infobar_delegate_android.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698