| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/android/mock_location_settings.h" | 5 #include "chrome/browser/android/mock_location_settings.h" |
| 6 | 6 |
| 7 bool MockLocationSettings::has_android_location_permission_ = false; | 7 bool MockLocationSettings::has_android_location_permission_ = false; |
| 8 bool MockLocationSettings::is_system_location_setting_enabled_ = false; | 8 bool MockLocationSettings::is_system_location_setting_enabled_ = false; |
| 9 bool MockLocationSettings::can_prompt_for_android_location_permission_ = false; | 9 bool MockLocationSettings::can_prompt_for_android_location_permission_ = false; |
| 10 bool MockLocationSettings::location_settings_dialog_enabled_ = false; | 10 bool MockLocationSettings::location_settings_dialog_enabled_ = false; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 bool enabled, | 33 bool enabled, |
| 34 LocationSettingsDialogOutcome outcome) { | 34 LocationSettingsDialogOutcome outcome) { |
| 35 location_settings_dialog_enabled_ = enabled; | 35 location_settings_dialog_enabled_ = enabled; |
| 36 location_settings_dialog_outcome_ = outcome; | 36 location_settings_dialog_outcome_ = outcome; |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool MockLocationSettings::HasShownLocationSettingsDialog() { | 39 bool MockLocationSettings::HasShownLocationSettingsDialog() { |
| 40 return has_shown_location_settings_dialog_; | 40 return has_shown_location_settings_dialog_; |
| 41 } | 41 } |
| 42 | 42 |
| 43 void MockLocationSettings::ClearHasShownLocationSettingsDialog() { |
| 44 has_shown_location_settings_dialog_ = false; |
| 45 } |
| 46 |
| 43 bool MockLocationSettings::HasAndroidLocationPermission() { | 47 bool MockLocationSettings::HasAndroidLocationPermission() { |
| 44 return has_android_location_permission_; | 48 return has_android_location_permission_; |
| 45 } | 49 } |
| 46 | 50 |
| 47 bool MockLocationSettings::CanPromptForAndroidLocationPermission( | 51 bool MockLocationSettings::CanPromptForAndroidLocationPermission( |
| 48 content::WebContents* web_contents) { | 52 content::WebContents* web_contents) { |
| 49 return can_prompt_for_android_location_permission_; | 53 return can_prompt_for_android_location_permission_; |
| 50 } | 54 } |
| 51 | 55 |
| 52 bool MockLocationSettings::IsSystemLocationSettingEnabled() { | 56 bool MockLocationSettings::IsSystemLocationSettingEnabled() { |
| 53 return is_system_location_setting_enabled_; | 57 return is_system_location_setting_enabled_; |
| 54 } | 58 } |
| 55 | 59 |
| 56 bool MockLocationSettings::CanPromptToEnableSystemLocationSetting() { | 60 bool MockLocationSettings::CanPromptToEnableSystemLocationSetting() { |
| 57 return location_settings_dialog_enabled_; | 61 return location_settings_dialog_enabled_; |
| 58 } | 62 } |
| 59 | 63 |
| 60 void MockLocationSettings::PromptToEnableSystemLocationSetting( | 64 void MockLocationSettings::PromptToEnableSystemLocationSetting( |
| 61 const LocationSettingsDialogContext prompt_context, | 65 const LocationSettingsDialogContext prompt_context, |
| 62 content::WebContents* web_contents, | 66 content::WebContents* web_contents, |
| 63 LocationSettingsDialogOutcomeCallback callback) { | 67 LocationSettingsDialogOutcomeCallback callback) { |
| 64 has_shown_location_settings_dialog_ = true; | 68 has_shown_location_settings_dialog_ = true; |
| 65 std::move(callback).Run(location_settings_dialog_outcome_); | 69 std::move(callback).Run(location_settings_dialog_outcome_); |
| 66 } | 70 } |
| OLD | NEW |