OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <ostream> | 9 #include <ostream> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 #include "chrome/browser/chromeos/arc/arc_support_host.h" | 16 #include "chrome/browser/chromeos/arc/arc_support_host.h" |
17 #include "chrome/browser/chromeos/policy/android_management_client.h" | 17 #include "chrome/browser/chromeos/policy/android_management_client.h" |
18 #include "components/arc/arc_session_runner.h" | 18 #include "components/arc/arc_session_runner.h" |
19 #include "components/arc/arc_stop_reason.h" | 19 #include "components/arc/arc_stop_reason.h" |
20 | 20 |
21 class ArcAppLauncher; | 21 class ArcAppLauncher; |
| 22 class PrefRegistrySimple; |
22 class Profile; | 23 class Profile; |
23 | 24 |
24 namespace user_prefs { | 25 namespace user_prefs { |
25 class PrefRegistrySyncable; | 26 class PrefRegistrySyncable; |
26 } | 27 } |
27 | 28 |
28 namespace arc { | 29 namespace arc { |
29 | 30 |
30 class ArcAndroidManagementChecker; | 31 class ArcAndroidManagementChecker; |
31 class ArcAuthContext; | 32 class ArcAuthContext; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 112 |
112 explicit ArcSessionManager( | 113 explicit ArcSessionManager( |
113 std::unique_ptr<ArcSessionRunner> arc_session_runner); | 114 std::unique_ptr<ArcSessionRunner> arc_session_runner); |
114 ~ArcSessionManager() override; | 115 ~ArcSessionManager() override; |
115 | 116 |
116 static ArcSessionManager* Get(); | 117 static ArcSessionManager* Get(); |
117 | 118 |
118 // Exposed here for unit_tests validation. | 119 // Exposed here for unit_tests validation. |
119 static bool IsOobeOptInActive(); | 120 static bool IsOobeOptInActive(); |
120 | 121 |
121 // It is called from chrome/browser/prefs/browser_prefs.cc. | 122 // Pref registration is called from chrome/browser/prefs/browser_prefs.cc. |
122 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 123 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 124 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry); |
123 | 125 |
124 static void DisableUIForTesting(); | 126 static void DisableUIForTesting(); |
125 static void EnableCheckAndroidManagementForTesting(); | 127 static void EnableCheckAndroidManagementForTesting(); |
126 | 128 |
127 // Returns true if ARC is allowed to run for the current session. | 129 // Returns true if ARC is allowed to run for the current session. |
128 // TODO(hidehiko): The name is very close to IsArcAllowedForProfile(), but | 130 // TODO(hidehiko): The name is very close to IsArcAllowedForProfile(), but |
129 // has different meaning. Clean this up. | 131 // has different meaning. Clean this up. |
130 bool IsAllowed() const; | 132 bool IsAllowed() const; |
131 | 133 |
132 void Shutdown(); | 134 void Shutdown(); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 DISALLOW_COPY_AND_ASSIGN(ArcSessionManager); | 345 DISALLOW_COPY_AND_ASSIGN(ArcSessionManager); |
344 }; | 346 }; |
345 | 347 |
346 // Outputs the stringified |state| to |os|. This is only for logging purposes. | 348 // Outputs the stringified |state| to |os|. This is only for logging purposes. |
347 std::ostream& operator<<(std::ostream& os, | 349 std::ostream& operator<<(std::ostream& os, |
348 const ArcSessionManager::State& state); | 350 const ArcSessionManager::State& state); |
349 | 351 |
350 } // namespace arc | 352 } // namespace arc |
351 | 353 |
352 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ | 354 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ |
OLD | NEW |