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

Side by Side Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 12676017: Adding policy support to the new network configuration stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed remaining comments of Steven. Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/chromeos/login/login_utils.h" 5 #include "chrome/browser/chromeos/login/login_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/chromeos/chromeos_version.h" 10 #include "base/chromeos/chromeos_version.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 #include "chrome/browser/signin/token_service.h" 66 #include "chrome/browser/signin/token_service.h"
67 #include "chrome/browser/signin/token_service_factory.h" 67 #include "chrome/browser/signin/token_service_factory.h"
68 #include "chrome/browser/sync/profile_sync_service.h" 68 #include "chrome/browser/sync/profile_sync_service.h"
69 #include "chrome/browser/sync/profile_sync_service_factory.h" 69 #include "chrome/browser/sync/profile_sync_service_factory.h"
70 #include "chrome/browser/ui/startup/startup_browser_creator.h" 70 #include "chrome/browser/ui/startup/startup_browser_creator.h"
71 #include "chrome/common/chrome_notification_types.h" 71 #include "chrome/common/chrome_notification_types.h"
72 #include "chrome/common/chrome_paths.h" 72 #include "chrome/common/chrome_paths.h"
73 #include "chrome/common/chrome_switches.h" 73 #include "chrome/common/chrome_switches.h"
74 #include "chrome/common/logging_chrome.h" 74 #include "chrome/common/logging_chrome.h"
75 #include "chrome/common/pref_names.h" 75 #include "chrome/common/pref_names.h"
76 #include "chromeos/chromeos_switches.h"
76 #include "chromeos/dbus/dbus_thread_manager.h" 77 #include "chromeos/dbus/dbus_thread_manager.h"
77 #include "chromeos/dbus/session_manager_client.h" 78 #include "chromeos/dbus/session_manager_client.h"
78 #include "content/public/browser/browser_thread.h" 79 #include "content/public/browser/browser_thread.h"
79 #include "content/public/browser/notification_observer.h" 80 #include "content/public/browser/notification_observer.h"
80 #include "content/public/browser/notification_service.h" 81 #include "content/public/browser/notification_service.h"
81 #include "google_apis/gaia/gaia_auth_consumer.h" 82 #include "google_apis/gaia/gaia_auth_consumer.h"
82 #include "google_apis/gaia/gaia_constants.h" 83 #include "google_apis/gaia/gaia_constants.h"
83 #include "google_apis/gaia/gaia_urls.h" 84 #include "google_apis/gaia/gaia_urls.h"
84 #include "googleurl/src/gurl.h" 85 #include "googleurl/src/gurl.h"
85 #include "net/base/network_change_notifier.h" 86 #include "net/base/network_change_notifier.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 UserManager::Get()->GetLoggedInUser()->display_email()); 419 UserManager::Get()->GetLoggedInUser()->display_email());
419 } 420 }
420 421
421 // Make sure we flip every profile to not share proxies if the user hasn't 422 // Make sure we flip every profile to not share proxies if the user hasn't
422 // specified so explicitly. 423 // specified so explicitly.
423 const PrefService::Preference* use_shared_proxies_pref = 424 const PrefService::Preference* use_shared_proxies_pref =
424 user_profile->GetPrefs()->FindPreference(prefs::kUseSharedProxies); 425 user_profile->GetPrefs()->FindPreference(prefs::kUseSharedProxies);
425 if (use_shared_proxies_pref->IsDefaultValue()) 426 if (use_shared_proxies_pref->IsDefaultValue())
426 user_profile->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false); 427 user_profile->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false);
427 428
428 // Locally managed users do not have user policy initialized. 429 // Notify the network configuration updater that policies are initialized. If
429 if (!UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { 430 // there is no policy, it will read an empty policy which is fine.
430 policy::NetworkConfigurationUpdater* network_configuration_updater = 431 g_browser_process->browser_policy_connector()->
431 g_browser_process->browser_policy_connector()-> 432 GetNetworkConfigurationUpdater()->OnUserPolicyInitialized();
432 GetNetworkConfigurationUpdater();
433 if (network_configuration_updater)
434 network_configuration_updater->OnUserPolicyInitialized();
435 }
436 433
437 RespectLocalePreference(user_profile); 434 RespectLocalePreference(user_profile);
438 } 435 }
439 436
440 void LoginUtilsImpl::InitSessionRestoreStrategy() { 437 void LoginUtilsImpl::InitSessionRestoreStrategy() {
441 CommandLine* command_line = CommandLine::ForCurrentProcess(); 438 CommandLine* command_line = CommandLine::ForCurrentProcess();
442 bool in_app_mode = chrome::IsRunningInForcedAppMode(); 439 bool in_app_mode = chrome::IsRunningInForcedAppMode();
443 440
444 // Are we in kiosk app mode? 441 // Are we in kiosk app mode?
445 if (in_app_mode) { 442 if (in_app_mode) {
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 bool LoginUtils::IsWhitelisted(const std::string& username) { 948 bool LoginUtils::IsWhitelisted(const std::string& username) {
952 CrosSettings* cros_settings = CrosSettings::Get(); 949 CrosSettings* cros_settings = CrosSettings::Get();
953 bool allow_new_user = false; 950 bool allow_new_user = false;
954 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 951 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
955 if (allow_new_user) 952 if (allow_new_user)
956 return true; 953 return true;
957 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); 954 return cros_settings->FindEmailInList(kAccountsPrefUsers, username);
958 } 955 }
959 956
960 } // namespace chromeos 957 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698