| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_google_location_settings_helper.h" | 5 #include "chrome/browser/android/mock_google_location_settings_helper.h" |
| 6 | 6 |
| 7 bool MockGoogleLocationSettingsHelper::master_location_enabled = false; | 7 bool MockGoogleLocationSettingsHelper::master_location_enabled = false; |
| 8 bool MockGoogleLocationSettingsHelper::google_apps_location_enabled = false; | 8 bool MockGoogleLocationSettingsHelper::google_apps_location_enabled = false; |
| 9 bool MockGoogleLocationSettingsHelper::was_google_location_settings_called | 9 bool MockGoogleLocationSettingsHelper::was_google_location_settings_called |
| 10 = false; | 10 = false; |
| 11 | 11 |
| 12 // Factory function | 12 // Factory function |
| 13 GoogleLocationSettingsHelper* GoogleLocationSettingsHelper::Create() { | 13 GoogleLocationSettingsHelper* GoogleLocationSettingsHelper::Create() { |
| 14 return new MockGoogleLocationSettingsHelper(); | 14 return new MockGoogleLocationSettingsHelper(); |
| 15 } | 15 } |
| 16 | 16 |
| 17 MockGoogleLocationSettingsHelper::MockGoogleLocationSettingsHelper() | 17 MockGoogleLocationSettingsHelper::MockGoogleLocationSettingsHelper() |
| 18 : GoogleLocationSettingsHelper() { | 18 : GoogleLocationSettingsHelper() { |
| 19 } | 19 } |
| 20 | 20 |
| 21 MockGoogleLocationSettingsHelper::~MockGoogleLocationSettingsHelper() { | 21 MockGoogleLocationSettingsHelper::~MockGoogleLocationSettingsHelper() { |
| 22 } | 22 } |
| 23 | 23 |
| 24 void MockGoogleLocationSettingsHelper::SetLocationStatus( | 24 void MockGoogleLocationSettingsHelper::SetLocationStatus( |
| 25 bool master, bool google_apps) { | 25 bool master, bool google_apps) { |
| 26 master_location_enabled = master; | 26 master_location_enabled = master; |
| 27 google_apps_location_enabled = google_apps; | 27 google_apps_location_enabled = google_apps; |
| 28 } | 28 } |
| 29 | 29 |
| 30 std::string MockGoogleLocationSettingsHelper::GetAcceptButtonLabel() { | 30 std::string MockGoogleLocationSettingsHelper::GetAcceptButtonLabel(bool allow) { |
| 31 return google_apps_location_enabled ? "Allow" : "Settings"; | 31 return IsAllowLabel() ? "Allow" : "Settings"; |
| 32 } | 32 } |
| 33 | 33 |
| 34 void MockGoogleLocationSettingsHelper::ShowGoogleLocationSettings() { | 34 void MockGoogleLocationSettingsHelper::ShowGoogleLocationSettings() { |
| 35 was_google_location_settings_called = true; | 35 was_google_location_settings_called = true; |
| 36 } | 36 } |
| 37 | 37 |
| 38 bool MockGoogleLocationSettingsHelper::IsGoogleAppsLocationSettingEnabled() { | 38 bool MockGoogleLocationSettingsHelper::IsGoogleAppsLocationSettingEnabled() { |
| 39 return google_apps_location_enabled; | 39 return google_apps_location_enabled; |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool MockGoogleLocationSettingsHelper::IsMasterLocationSettingEnabled() { | 42 bool MockGoogleLocationSettingsHelper::IsMasterLocationSettingEnabled() { |
| 43 return master_location_enabled; | 43 return master_location_enabled; |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool MockGoogleLocationSettingsHelper::WasGoogleLocationSettingsCalled() { | 46 bool MockGoogleLocationSettingsHelper::WasGoogleLocationSettingsCalled() { |
| 47 return was_google_location_settings_called; | 47 return was_google_location_settings_called; |
| 48 } | 48 } |
| 49 |
| 50 bool MockGoogleLocationSettingsHelper::IsAllowLabel() { |
| 51 return google_apps_location_enabled; |
| 52 } |
| OLD | NEW |