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

Side by Side Diff: chrome/browser/chromeos/login/session/chrome_session_manager.cc

Issue 2900903002: Create a FakeTetherService, which stubs out TetherService for development. (Closed)
Patch Set: Fix TetherService tests. Created 3 years, 7 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/login/session/chrome_session_manager.h" 5 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/sys_info.h" 12 #include "base/sys_info.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/browser_process_platform_part_chromeos.h" 14 #include "chrome/browser/browser_process_platform_part_chromeos.h"
15 #include "chrome/browser/chrome_notification_types.h" 15 #include "chrome/browser/chrome_notification_types.h"
16 #include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h" 16 #include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h"
17 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" 17 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h"
18 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" 18 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
19 #include "chrome/browser/chromeos/arc/arc_service_launcher.h" 19 #include "chrome/browser/chromeos/arc/arc_service_launcher.h"
20 #include "chrome/browser/chromeos/boot_times_recorder.h" 20 #include "chrome/browser/chromeos/boot_times_recorder.h"
21 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h" 21 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h"
22 #include "chrome/browser/chromeos/login/login_wizard.h" 22 #include "chrome/browser/chromeos/login/login_wizard.h"
23 #include "chrome/browser/chromeos/login/session/user_session_manager.h" 23 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
24 #include "chrome/browser/chromeos/login/wizard_controller.h" 24 #include "chrome/browser/chromeos/login/wizard_controller.h"
25 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 25 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
26 #include "chrome/browser/chromeos/tether/tether_service.h"
26 #include "chrome/browser/profiles/profile.h" 27 #include "chrome/browser/profiles/profile.h"
27 #include "chrome/browser/signin/signin_manager_factory.h" 28 #include "chrome/browser/signin/signin_manager_factory.h"
28 #include "chrome/browser/ui/ash/ash_util.h" 29 #include "chrome/browser/ui/ash/ash_util.h"
29 #include "chrome/common/chrome_switches.h" 30 #include "chrome/common/chrome_switches.h"
30 #include "chrome/common/pref_names.h" 31 #include "chrome/common/pref_names.h"
31 #include "chromeos/audio/cras_audio_handler.h" 32 #include "chromeos/audio/cras_audio_handler.h"
32 #include "chromeos/chromeos_switches.h" 33 #include "chromeos/chromeos_switches.h"
33 #include "chromeos/cryptohome/cryptohome_parameters.h" 34 #include "chromeos/cryptohome/cryptohome_parameters.h"
34 #include "chromeos/dbus/dbus_thread_manager.h" 35 #include "chromeos/dbus/dbus_thread_manager.h"
35 #include "chromeos/dbus/session_manager_client.h" 36 #include "chromeos/dbus/session_manager_client.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 LOG(ERROR) << "Could not get active user after crash."; 103 LOG(ERROR) << "Could not get active user after crash.";
103 return; 104 return;
104 } 105 }
105 user_session_mgr->InitRlz(user_profile); 106 user_session_mgr->InitRlz(user_profile);
106 user_session_mgr->InitializeCerts(user_profile); 107 user_session_mgr->InitializeCerts(user_profile);
107 user_session_mgr->InitializeCRLSetFetcher(user); 108 user_session_mgr->InitializeCRLSetFetcher(user);
108 user_session_mgr->InitializeCertificateTransparencyComponents(user); 109 user_session_mgr->InitializeCertificateTransparencyComponents(user);
109 110
110 arc::ArcServiceLauncher::Get()->OnPrimaryUserProfilePrepared(user_profile); 111 arc::ArcServiceLauncher::Get()->OnPrimaryUserProfilePrepared(user_profile);
111 112
113 TetherService* tether_service = TetherService::Get(user_profile);
114 if (tether_service)
115 tether_service->StartTetherIfEnabled();
116
112 // Send the PROFILE_PREPARED notification and call SessionStarted() 117 // Send the PROFILE_PREPARED notification and call SessionStarted()
113 // so that the Launcher and other Profile dependent classes are created. 118 // so that the Launcher and other Profile dependent classes are created.
114 content::NotificationService::current()->Notify( 119 content::NotificationService::current()->Notify(
115 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, 120 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
116 content::NotificationService::AllSources(), 121 content::NotificationService::AllSources(),
117 content::Details<Profile>(user_profile)); 122 content::Details<Profile>(user_profile));
118 123
119 // This call will set session state to SESSION_STATE_ACTIVE (same one). 124 // This call will set session state to SESSION_STATE_ACTIVE (same one).
120 session_manager::SessionManager::Get()->SessionStarted(); 125 session_manager::SessionManager::Get()->SessionStarted();
121 126
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 const std::string& user_id_hash, 231 const std::string& user_id_hash,
227 bool browser_restart) { 232 bool browser_restart) {
228 BootTimesRecorder* btl = BootTimesRecorder::Get(); 233 BootTimesRecorder* btl = BootTimesRecorder::Get();
229 btl->AddLoginTimeMarker("UserLoggedIn-Start", false); 234 btl->AddLoginTimeMarker("UserLoggedIn-Start", false);
230 session_manager::SessionManager::NotifyUserLoggedIn( 235 session_manager::SessionManager::NotifyUserLoggedIn(
231 user_account_id, user_id_hash, browser_restart); 236 user_account_id, user_id_hash, browser_restart);
232 btl->AddLoginTimeMarker("UserLoggedIn-End", false); 237 btl->AddLoginTimeMarker("UserLoggedIn-End", false);
233 } 238 }
234 239
235 } // namespace chromeos 240 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/login/session/user_session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698