| Index: chrome/browser/android/mock_location_settings.cc
|
| diff --git a/chrome/browser/android/mock_location_settings.cc b/chrome/browser/android/mock_location_settings.cc
|
| index 27de84236ed8144ee2d27fe5fc784440db383209..6f37718075e1a339c5eed1eda6e68e8afe853f4b 100644
|
| --- a/chrome/browser/android/mock_location_settings.cc
|
| +++ b/chrome/browser/android/mock_location_settings.cc
|
| @@ -4,8 +4,14 @@
|
|
|
| #include "chrome/browser/android/mock_location_settings.h"
|
|
|
| -bool MockLocationSettings::master_location_enabled = false;
|
| -bool MockLocationSettings::google_apps_location_enabled = false;
|
| +bool MockLocationSettings::has_android_location_permission = false;
|
| +bool MockLocationSettings::is_system_location_setting_enabled = false;
|
| +bool MockLocationSettings::can_prompt_for_android_location_permission = false;
|
| +bool MockLocationSettings::location_settings_dialog_enabled = false;
|
| +LocationSettings::LocationSettingsDialogOutcome
|
| + MockLocationSettings::location_settings_dialog_outcome =
|
| + LocationSettings::NO_PROMPT;
|
| +bool MockLocationSettings::has_shown_location_settings_dialog = false;
|
|
|
| MockLocationSettings::MockLocationSettings() : LocationSettings() {
|
| }
|
| @@ -13,33 +19,46 @@ MockLocationSettings::MockLocationSettings() : LocationSettings() {
|
| MockLocationSettings::~MockLocationSettings() {
|
| }
|
|
|
| -void MockLocationSettings::SetLocationStatus(
|
| - bool master, bool google_apps) {
|
| - master_location_enabled = master;
|
| - google_apps_location_enabled = google_apps;
|
| +void MockLocationSettings::SetLocationStatus(bool android, bool system) {
|
| + has_android_location_permission = android;
|
| + is_system_location_setting_enabled = system;
|
| }
|
|
|
| -bool MockLocationSettings::IsGoogleAppsLocationSettingEnabled() {
|
| - return google_apps_location_enabled;
|
| +void MockLocationSettings::SetCanPromptForAndroidPermission(bool can_prompt) {
|
| + can_prompt_for_android_location_permission = can_prompt;
|
| }
|
|
|
| -bool MockLocationSettings::IsMasterLocationSettingEnabled() {
|
| - return master_location_enabled;
|
| +void MockLocationSettings::SetLocationSettingsDialogStatus(
|
| + bool enabled,
|
| + LocationSettingsDialogOutcome outcome) {
|
| + location_settings_dialog_enabled = enabled;
|
| + location_settings_dialog_outcome = outcome;
|
| }
|
|
|
| -bool MockLocationSettings::CanSitesRequestLocationPermission(
|
| +bool MockLocationSettings::HasShownLocationSettingsDialog() {
|
| + return has_shown_location_settings_dialog;
|
| +}
|
| +
|
| +bool MockLocationSettings::HasAndroidLocationPermission() {
|
| + return has_android_location_permission;
|
| +}
|
| +
|
| +bool MockLocationSettings::CanPromptForAndroidLocationPermission(
|
| content::WebContents* web_contents) {
|
| - return IsMasterLocationSettingEnabled() &&
|
| - IsGoogleAppsLocationSettingEnabled();
|
| + return can_prompt_for_android_location_permission;
|
| +}
|
| +
|
| +bool MockLocationSettings::IsSystemLocationSettingEnabled() {
|
| + return is_system_location_setting_enabled;
|
| }
|
|
|
| bool MockLocationSettings::CanPromptToEnableSystemLocationSetting() {
|
| - return false;
|
| + return location_settings_dialog_enabled;
|
| }
|
|
|
| void MockLocationSettings::PromptToEnableSystemLocationSetting(
|
| const LocationSettingsDialogContext prompt_context,
|
| content::WebContents* web_contents,
|
| LocationSettingsDialogOutcomeCallback callback) {
|
| - std::move(callback).Run(LocationSettingsDialogOutcome::NO_PROMPT);
|
| + std::move(callback).Run(location_settings_dialog_outcome);
|
| }
|
|
|