Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4397)

Unified Diff: chrome/browser/chromeos/arc/arc_session_manager.cc

Issue 2553193002: Remove explicit singletonness of ArcBridgeService part 4. (Closed)
Patch Set: Address comments. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/arc/arc_session_manager.cc
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.cc b/chrome/browser/chromeos/arc/arc_session_manager.cc
index 6107f7ff95a49ec38d9202f69016dcf119eb30e8..28c084946b2528ad274f6ab4826f4dfd1a820c3d 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager.cc
@@ -81,7 +81,9 @@ ash::ShelfDelegate* GetShelfDelegate() {
} // namespace
ArcSessionManager::ArcSessionManager(ArcBridgeService* bridge_service)
- : ArcService(bridge_service), weak_ptr_factory_(this) {
+ : ArcService(bridge_service),
+ attempt_user_exit_callback_(base::Bind(chrome::AttemptUserExit)),
+ weak_ptr_factory_(this) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(!g_arc_session_manager);
g_arc_session_manager = this;
@@ -291,7 +293,7 @@ void ArcSessionManager::OnProvisioningFinished(ProvisioningResult result) {
VLOG(1) << "Robot account auth code fetching error";
// Log out the user. All the cleanup will be done in Shutdown() method.
// The callback is not called because auth code is empty.
- chrome::AttemptUserExit();
+ attempt_user_exit_callback_.Run();
return;
}
@@ -898,6 +900,12 @@ void ArcSessionManager::OnSendFeedbackClicked() {
chrome::OpenFeedbackDialog(nullptr);
}
+void ArcSessionManager::SetAttemptUserExitCallbackForTesting(
+ const base::Closure& callback) {
+ DCHECK(!callback.is_null());
+ attempt_user_exit_callback_ = callback;
+}
+
std::ostream& operator<<(std::ostream& os,
const ArcSessionManager::State& state) {
switch (state) {
« no previous file with comments | « chrome/browser/chromeos/arc/arc_session_manager.h ('k') | chrome/browser/chromeos/arc/arc_session_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698