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