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

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 Julian's comments. Reuploaded with rebase. 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 UserManager::Get()->GetLoggedInUser()->display_email()); 427 UserManager::Get()->GetLoggedInUser()->display_email());
427 } 428 }
428 429
429 // Make sure we flip every profile to not share proxies if the user hasn't 430 // Make sure we flip every profile to not share proxies if the user hasn't
430 // specified so explicitly. 431 // specified so explicitly.
431 const PrefService::Preference* use_shared_proxies_pref = 432 const PrefService::Preference* use_shared_proxies_pref =
432 user_profile->GetPrefs()->FindPreference(prefs::kUseSharedProxies); 433 user_profile->GetPrefs()->FindPreference(prefs::kUseSharedProxies);
433 if (use_shared_proxies_pref->IsDefaultValue()) 434 if (use_shared_proxies_pref->IsDefaultValue())
434 user_profile->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false); 435 user_profile->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false);
435 436
436 // Locally managed users do not have user policy initialized. 437 // Notify the network configuration updater that policies are initialized. If
437 if (!UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { 438 // there is no policy, it will read an empty policy which is fine.
438 policy::NetworkConfigurationUpdater* network_configuration_updater = 439 g_browser_process->browser_policy_connector()->
439 g_browser_process->browser_policy_connector()-> 440 GetNetworkConfigurationUpdater()->OnUserPolicyInitialized();
440 GetNetworkConfigurationUpdater();
441 if (network_configuration_updater)
442 network_configuration_updater->OnUserPolicyInitialized();
443 }
444 441
445 RespectLocalePreference(user_profile); 442 RespectLocalePreference(user_profile);
446 } 443 }
447 444
448 void LoginUtilsImpl::InitSessionRestoreStrategy() { 445 void LoginUtilsImpl::InitSessionRestoreStrategy() {
449 CommandLine* command_line = CommandLine::ForCurrentProcess(); 446 CommandLine* command_line = CommandLine::ForCurrentProcess();
450 bool in_app_mode = chrome::IsRunningInForcedAppMode(); 447 bool in_app_mode = chrome::IsRunningInForcedAppMode();
451 448
452 // Are we in kiosk app mode? 449 // Are we in kiosk app mode?
453 if (in_app_mode) { 450 if (in_app_mode) {
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 bool LoginUtils::IsWhitelisted(const std::string& username) { 956 bool LoginUtils::IsWhitelisted(const std::string& username) {
960 CrosSettings* cros_settings = CrosSettings::Get(); 957 CrosSettings* cros_settings = CrosSettings::Get();
961 bool allow_new_user = false; 958 bool allow_new_user = false;
962 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 959 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
963 if (allow_new_user) 960 if (allow_new_user)
964 return true; 961 return true;
965 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); 962 return cros_settings->FindEmailInList(kAccountsPrefUsers, username);
966 } 963 }
967 964
968 } // namespace chromeos 965 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698