| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/policy/cloud/user_policy_signin_service_base.h" | 5 #include "chrome/browser/policy/cloud/user_policy_signin_service_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 10 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 UserCloudPolicyManager* manager = policy_manager(); | 63 UserCloudPolicyManager* manager = policy_manager(); |
| 64 DCHECK(manager); | 64 DCHECK(manager); |
| 65 DCHECK(!manager->core()->client()); | 65 DCHECK(!manager->core()->client()); |
| 66 InitializeUserCloudPolicyManager(username, client.Pass()); | 66 InitializeUserCloudPolicyManager(username, client.Pass()); |
| 67 DCHECK(manager->IsClientRegistered()); | 67 DCHECK(manager->IsClientRegistered()); |
| 68 | 68 |
| 69 // Now initiate a policy fetch. | 69 // Now initiate a policy fetch. |
| 70 manager->core()->service()->RefreshPolicy(callback); | 70 manager->core()->service()->RefreshPolicy(callback); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void UserPolicySigninServiceBase::GoogleSignedOut(const std::string& username) { | 73 void UserPolicySigninServiceBase::GoogleSignedOut(const std::string& account_id, |
| 74 const std::string& username) { |
| 74 ShutdownUserCloudPolicyManager(); | 75 ShutdownUserCloudPolicyManager(); |
| 75 } | 76 } |
| 76 | 77 |
| 77 void UserPolicySigninServiceBase::Observe( | 78 void UserPolicySigninServiceBase::Observe( |
| 78 int type, | 79 int type, |
| 79 const content::NotificationSource& source, | 80 const content::NotificationSource& source, |
| 80 const content::NotificationDetails& details) { | 81 const content::NotificationDetails& details) { |
| 81 switch (type) { | 82 switch (type) { |
| 82 case chrome::NOTIFICATION_PROFILE_ADDED: | 83 case chrome::NOTIFICATION_PROFILE_ADDED: |
| 83 // A new profile has been loaded - if it's signed in, then initialize the | 84 // A new profile has been loaded - if it's signed in, then initialize the |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 } | 262 } |
| 262 | 263 |
| 263 scoped_refptr<net::URLRequestContextGetter> | 264 scoped_refptr<net::URLRequestContextGetter> |
| 264 UserPolicySigninServiceBase::CreateUserRequestContext( | 265 UserPolicySigninServiceBase::CreateUserRequestContext( |
| 265 scoped_refptr<net::URLRequestContextGetter> profile_request_context) { | 266 scoped_refptr<net::URLRequestContextGetter> profile_request_context) { |
| 266 return new UserPolicyRequestContext( | 267 return new UserPolicyRequestContext( |
| 267 profile_request_context, system_request_context(), GetUserAgent()); | 268 profile_request_context, system_request_context(), GetUserAgent()); |
| 268 } | 269 } |
| 269 | 270 |
| 270 } // namespace policy | 271 } // namespace policy |
| OLD | NEW |