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

Side by Side Diff: chrome/browser/policy/cloud/user_policy_signin_service.cc

Issue 643183003: Adding instrumentation to locate the source of jankiness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/policy/cloud/user_policy_signin_service.h" 5 #include "chrome/browser/policy/cloud/user_policy_signin_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/profiler/scoped_profile.h"
10 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/chrome_notification_types.h" 12 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/profiles/profile_manager.h" 14 #include "chrome/browser/profiles/profile_manager.h"
14 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 15 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
15 #include "components/policy/core/common/cloud/cloud_policy_client_registration_h elper.h" 16 #include "components/policy/core/common/cloud/cloud_policy_client_registration_h elper.h"
16 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" 17 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
17 #include "components/signin/core/browser/profile_oauth2_token_service.h" 18 #include "components/signin/core/browser/profile_oauth2_token_service.h"
18 #include "components/signin/core/browser/signin_manager.h" 19 #include "components/signin/core/browser/signin_manager.h"
19 #include "content/public/browser/notification_details.h" 20 #include "content/public/browser/notification_details.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 101
101 void UserPolicySigninService::CallPolicyRegistrationCallback( 102 void UserPolicySigninService::CallPolicyRegistrationCallback(
102 scoped_ptr<CloudPolicyClient> client, 103 scoped_ptr<CloudPolicyClient> client,
103 PolicyRegistrationCallback callback) { 104 PolicyRegistrationCallback callback) {
104 registration_helper_.reset(); 105 registration_helper_.reset();
105 callback.Run(client->dm_token(), client->client_id()); 106 callback.Run(client->dm_token(), client->client_id());
106 } 107 }
107 108
108 void UserPolicySigninService::OnRefreshTokenAvailable( 109 void UserPolicySigninService::OnRefreshTokenAvailable(
109 const std::string& account_id) { 110 const std::string& account_id) {
111 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422460 is fixed.
112 tracked_objects::ScopedProfile tracking_profile(
113 FROM_HERE_WITH_EXPLICIT_FUNCTION(
114 "422460 UserPolicySigninService::OnRefreshTokenAvailable"));
115
110 // If using a TestingProfile with no UserCloudPolicyManager, skip 116 // If using a TestingProfile with no UserCloudPolicyManager, skip
111 // initialization. 117 // initialization.
112 if (!policy_manager()) { 118 if (!policy_manager()) {
113 DVLOG(1) << "Skipping initialization for tests due to missing components."; 119 DVLOG(1) << "Skipping initialization for tests due to missing components.";
114 return; 120 return;
115 } 121 }
116 122
117 // Ignore OAuth tokens for any account but the primary one. 123 // Ignore OAuth tokens for any account but the primary one.
118 if (account_id != signin_manager()->GetAuthenticatedAccountId()) 124 if (account_id != signin_manager()->GetAuthenticatedAccountId())
119 return; 125 return;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 195 }
190 196
191 void UserPolicySigninService::ProhibitSignoutIfNeeded() { 197 void UserPolicySigninService::ProhibitSignoutIfNeeded() {
192 if (policy_manager()->IsClientRegistered()) { 198 if (policy_manager()->IsClientRegistered()) {
193 DVLOG(1) << "User is registered for policy - prohibiting signout"; 199 DVLOG(1) << "User is registered for policy - prohibiting signout";
194 signin_manager()->ProhibitSignout(true); 200 signin_manager()->ProhibitSignout(true);
195 } 201 }
196 } 202 }
197 203
198 } // namespace policy 204 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698