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

Unified Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 2819713002: Create TetherService, a TetherAllowed pref, and use DependencyManager for RegisterProfilePrefs call… (Closed)
Patch Set: Do not explicitly call on TetherService::Shutdown() from UserSessionManager. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/session/user_session_manager.cc
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc
index 1c9cc4e135106f957beec9bc5c980abb1d2d8b73..3d572e693c33afa554e7e33152b11a996d8ce245 100644
--- a/chrome/browser/chromeos/login/session/user_session_manager.cc
+++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -56,13 +56,11 @@
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
-#include "chrome/browser/chromeos/net/tether_notification_presenter.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/component_updater/ev_whitelist_component_installer.h"
#include "chrome/browser/component_updater/sth_set_component_installer.h"
-#include "chrome/browser/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/google/google_brand_chromeos.h"
#include "chrome/browser/lifetime/application_lifetime.h"
@@ -73,10 +71,10 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
#include "chrome/browser/signin/easy_unlock_service.h"
-#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
#include "chrome/browser/supervised_user/child_accounts/child_account_service_factory.h"
+#include "chrome/browser/tether/tether_service.h"
#include "chrome/browser/ui/app_list/app_list_service.h"
#include "chrome/browser/ui/startup/startup_browser_creator.h"
#include "chrome/common/channel_info.h"
@@ -85,15 +83,12 @@
#include "chrome/common/pref_names.h"
#include "chromeos/cert_loader.h"
#include "chromeos/chromeos_switches.h"
-#include "chromeos/components/tether/initializer.h"
#include "chromeos/cryptohome/cryptohome_parameters.h"
#include "chromeos/cryptohome/cryptohome_util.h"
#include "chromeos/dbus/cryptohome_client.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager_client.h"
#include "chromeos/login/auth/stub_authenticator.h"
-#include "chromeos/network/network_connect.h"
-#include "chromeos/network/network_state_handler.h"
#include "chromeos/network/portal_detector/network_portal_detector.h"
#include "chromeos/network/portal_detector/network_portal_detector_strategy.h"
#include "chromeos/settings/cros_settings_names.h"
@@ -1231,17 +1226,9 @@ void UserSessionManager::FinalizePrepareProfile(Profile* profile) {
arc::ArcServiceLauncher::Get()->OnPrimaryUserProfilePrepared(profile);
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- chromeos::switches::kEnableTether)) {
- auto notification_presenter =
- base::MakeUnique<tether::TetherNotificationPresenter>(
- message_center::MessageCenter::Get(), NetworkConnect::Get());
- chromeos::tether::Initializer::Init(
- ChromeCryptAuthServiceFactory::GetForBrowserContext(profile),
- std::move(notification_presenter), profile->GetPrefs(),
- ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
- NetworkHandler::Get()->network_state_handler(),
- NetworkConnect::Get());
+ TetherService* tether_service = TetherService::Get(profile);
+ if (tether_service) {
battre 2017/04/19 08:43:30 nit: {} are not necessary.
Ryan Hansberry 2017/04/19 17:46:06 Done.
Lei Zhang 2017/04/19 19:13:17 Is this ever false?
Ryan Hansberry 2017/04/20 17:22:32 Nope. Removed if statement.
+ tether_service->StartTether();
}
}
@@ -1925,11 +1912,6 @@ bool UserSessionManager::TokenHandlesEnabled() {
}
void UserSessionManager::Shutdown() {
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- chromeos::switches::kEnableTether)) {
- chromeos::tether::Initializer::Shutdown();
- }
-
token_handle_fetcher_.reset();
token_handle_util_.reset();
first_run::GoodiesDisplayer::Delete();

Powered by Google App Engine
This is Rietveld 408576698