1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "chrome/browser/android/mock_google_location_settings_helper.h" 6 7 bool MockGoogleLocationSettingsHelper::master_location_enabled = false; 8 bool MockGoogleLocationSettingsHelper::google_apps_location_enabled = false; 9 bool MockGoogleLocationSettingsHelper::was_google_location_settings_called 10 = false; 11 12 // Factory function 13 GoogleLocationSettingsHelper* GoogleLocationSettingsHelper::Create() { 14 return new MockGoogleLocationSettingsHelper(); 15 } 16 17 MockGoogleLocationSettingsHelper::MockGoogleLocationSettingsHelper() 18 : GoogleLocationSettingsHelper() { 19 } 20 21 MockGoogleLocationSettingsHelper::~MockGoogleLocationSettingsHelper() { 22 } 23 24 void MockGoogleLocationSettingsHelper::SetLocationStatus( 25 bool master, bool google_apps) { 26 master_location_enabled = master; 27 google_apps_location_enabled = google_apps; 28 } 29 30 std::string MockGoogleLocationSettingsHelper::GetAcceptButtonLabel() { 31 return google_apps_location_enabled ? "Allow" : "Settings"; 32 } 33 34 void MockGoogleLocationSettingsHelper::ShowGoogleLocationSettings() { 35 was_google_location_settings_called = true; 36 } 37 38 bool MockGoogleLocationSettingsHelper::IsGoogleAppsLocationSettingEnabled() { 39 return google_apps_location_enabled; 40 } 41 42 bool MockGoogleLocationSettingsHelper::IsMasterLocationSettingEnabled() { 43 return master_location_enabled; 44 } 45 46 bool MockGoogleLocationSettingsHelper::WasGoogleLocationSettingsCalled() { 47 return was_google_location_settings_called; 48 } 49