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

Side by Side Diff: chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc

Issue 398753004: [cros] Move User class to user_manager component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/policy/user_cloud_policy_manager_factory_chrom eos.h" 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/message_loop/message_loop_proxy.h" 12 #include "base/message_loop/message_loop_proxy.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/sequenced_task_runner.h" 14 #include "base/sequenced_task_runner.h"
15 #include "base/threading/sequenced_worker_pool.h" 15 #include "base/threading/sequenced_worker_pool.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/chromeos/login/login_utils.h" 18 #include "chrome/browser/chromeos/login/login_utils.h"
19 #include "chrome/browser/chromeos/login/users/user.h"
20 #include "chrome/browser/chromeos/login/users/user_manager.h" 19 #include "chrome/browser/chromeos/login/users/user_manager.h"
21 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 20 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
22 #include "chrome/browser/chromeos/policy/user_cloud_external_data_manager.h" 21 #include "chrome/browser/chromeos/policy/user_cloud_external_data_manager.h"
23 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" 22 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
24 #include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h" 23 #include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h"
25 #include "chrome/browser/chromeos/profiles/profile_helper.h" 24 #include "chrome/browser/chromeos/profiles/profile_helper.h"
26 #include "chrome/browser/policy/schema_registry_service.h" 25 #include "chrome/browser/policy/schema_registry_service.h"
27 #include "chrome/browser/policy/schema_registry_service_factory.h" 26 #include "chrome/browser/policy/schema_registry_service_factory.h"
28 #include "chrome/browser/profiles/profile.h" 27 #include "chrome/browser/profiles/profile.h"
29 #include "chromeos/chromeos_paths.h" 28 #include "chromeos/chromeos_paths.h"
30 #include "chromeos/chromeos_switches.h" 29 #include "chromeos/chromeos_switches.h"
31 #include "chromeos/dbus/dbus_thread_manager.h" 30 #include "chromeos/dbus/dbus_thread_manager.h"
32 #include "components/keyed_service/content/browser_context_dependency_manager.h" 31 #include "components/keyed_service/content/browser_context_dependency_manager.h"
33 #include "components/policy/core/browser/browser_policy_connector.h" 32 #include "components/policy/core/browser/browser_policy_connector.h"
34 #include "components/policy/core/common/cloud/cloud_external_data_manager.h" 33 #include "components/policy/core/common/cloud/cloud_external_data_manager.h"
35 #include "components/policy/core/common/cloud/device_management_service.h" 34 #include "components/policy/core/common/cloud/device_management_service.h"
35 #include "components/user_manager/user.h"
36 #include "components/user_manager/user_type.h" 36 #include "components/user_manager/user_type.h"
37 #include "content/public/browser/browser_thread.h" 37 #include "content/public/browser/browser_thread.h"
38 #include "net/url_request/url_request_context_getter.h" 38 #include "net/url_request/url_request_context_getter.h"
39 #include "policy/policy_constants.h" 39 #include "policy/policy_constants.h"
40 40
41 namespace policy { 41 namespace policy {
42 42
43 namespace { 43 namespace {
44 44
45 // Subdirectory in the user's profile for storing legacy user policies. 45 // Subdirectory in the user's profile for storing legacy user policies.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 bool force_immediate_load, 118 bool force_immediate_load,
119 scoped_refptr<base::SequencedTaskRunner> background_task_runner) { 119 scoped_refptr<base::SequencedTaskRunner> background_task_runner) {
120 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 120 const CommandLine* command_line = CommandLine::ForCurrentProcess();
121 // Don't initialize cloud policy for the signin profile. 121 // Don't initialize cloud policy for the signin profile.
122 if (chromeos::ProfileHelper::IsSigninProfile(profile)) 122 if (chromeos::ProfileHelper::IsSigninProfile(profile))
123 return scoped_ptr<UserCloudPolicyManagerChromeOS>(); 123 return scoped_ptr<UserCloudPolicyManagerChromeOS>();
124 124
125 // |user| should never be NULL except for the signin profile. This object is 125 // |user| should never be NULL except for the signin profile. This object is
126 // created as part of the Profile creation, which happens right after 126 // created as part of the Profile creation, which happens right after
127 // sign-in. The just-signed-in User is the active user during that time. 127 // sign-in. The just-signed-in User is the active user during that time.
128 chromeos::User* user = 128 user_manager::User* user =
129 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); 129 chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
130 CHECK(user); 130 CHECK(user);
131 131
132 // Only USER_TYPE_REGULAR users have user cloud policy. 132 // Only USER_TYPE_REGULAR users have user cloud policy.
133 // USER_TYPE_RETAIL_MODE, USER_TYPE_KIOSK_APP, USER_TYPE_GUEST and 133 // USER_TYPE_RETAIL_MODE, USER_TYPE_KIOSK_APP, USER_TYPE_GUEST and
134 // USER_TYPE_SUPERVISED are not signed in and can't authenticate the 134 // USER_TYPE_SUPERVISED are not signed in and can't authenticate the
135 // policy registration. 135 // policy registration.
136 // USER_TYPE_PUBLIC_ACCOUNT gets its policy from the 136 // USER_TYPE_PUBLIC_ACCOUNT gets its policy from the
137 // DeviceLocalAccountPolicyService. 137 // DeviceLocalAccountPolicyService.
138 // Non-managed domains will be skipped by the below check 138 // Non-managed domains will be skipped by the below check
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 252
253 bool UserCloudPolicyManagerFactoryChromeOS::HasTestingFactory( 253 bool UserCloudPolicyManagerFactoryChromeOS::HasTestingFactory(
254 content::BrowserContext* context) { 254 content::BrowserContext* context) {
255 return false; 255 return false;
256 } 256 }
257 257
258 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( 258 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow(
259 content::BrowserContext* context) {} 259 content::BrowserContext* context) {}
260 260
261 } // namespace policy 261 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698