| 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 using PromptContext = LocationSettings::PromptContext; |
| 8 using PromptOutcome = LocationSettings::PromptOutcome; |
| 9 |
| 7 bool MockLocationSettings::master_location_enabled = false; | 10 bool MockLocationSettings::master_location_enabled = false; |
| 8 bool MockLocationSettings::google_apps_location_enabled = false; | 11 bool MockLocationSettings::google_apps_location_enabled = false; |
| 9 | 12 |
| 10 MockLocationSettings::MockLocationSettings() : LocationSettings() { | 13 MockLocationSettings::MockLocationSettings() : LocationSettings() { |
| 11 } | 14 } |
| 12 | 15 |
| 13 MockLocationSettings::~MockLocationSettings() { | 16 MockLocationSettings::~MockLocationSettings() { |
| 14 } | 17 } |
| 15 | 18 |
| 16 void MockLocationSettings::SetLocationStatus( | 19 void MockLocationSettings::SetLocationStatus( |
| 17 bool master, bool google_apps) { | 20 bool master, bool google_apps) { |
| 18 master_location_enabled = master; | 21 master_location_enabled = master; |
| 19 google_apps_location_enabled = google_apps; | 22 google_apps_location_enabled = google_apps; |
| 20 } | 23 } |
| 21 | 24 |
| 22 bool MockLocationSettings::IsGoogleAppsLocationSettingEnabled() { | 25 bool MockLocationSettings::IsGoogleAppsLocationSettingEnabled() { |
| 23 return google_apps_location_enabled; | 26 return google_apps_location_enabled; |
| 24 } | 27 } |
| 25 | 28 |
| 26 bool MockLocationSettings::IsMasterLocationSettingEnabled() { | 29 bool MockLocationSettings::IsMasterLocationSettingEnabled() { |
| 27 return master_location_enabled; | 30 return master_location_enabled; |
| 28 } | 31 } |
| 29 | 32 |
| 30 bool MockLocationSettings::CanSitesRequestLocationPermission( | 33 bool MockLocationSettings::CanSitesRequestLocationPermission( |
| 31 content::WebContents* web_contents) { | 34 content::WebContents* web_contents) { |
| 32 return IsMasterLocationSettingEnabled() && | 35 return IsMasterLocationSettingEnabled() && |
| 33 IsGoogleAppsLocationSettingEnabled(); | 36 IsGoogleAppsLocationSettingEnabled(); |
| 34 } | 37 } |
| 38 |
| 39 void MockLocationSettings::CanPromptToEnableSystemLocationSetting( |
| 40 const base::Callback<void(bool can_prompt)>& callback) { |
| 41 callback.Run(false); |
| 42 } |
| 43 |
| 44 void MockLocationSettings::PromptToEnableSystemLocationSetting( |
| 45 const PromptContext prompt_context, |
| 46 content::WebContents* web_contents, |
| 47 const base::Callback<void(PromptOutcome prompt_outcome)>& callback) { |
| 48 callback.Run(PromptOutcome::NO_PROMPT); |
| 49 } |
| OLD | NEW |