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

Side by Side Diff: chrome/browser/supervised_user/supervised_user_registration_utility.cc

Issue 597423002: Device info datatype should be moved to components/sync_driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor CR feedback addressed. 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/supervised_user/supervised_user_registration_utility.h" 5 #include "chrome/browser/supervised_user/supervised_user_registration_utility.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
12 #include "base/rand_util.h" 12 #include "base/rand_util.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/signin/chrome_signin_client_factory.h" 15 #include "chrome/browser/signin/chrome_signin_client_factory.h"
16 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 16 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
17 #include "chrome/browser/signin/signin_manager_factory.h" 17 #include "chrome/browser/signin/signin_manager_factory.h"
18 #include "chrome/browser/supervised_user/supervised_user_constants.h" 18 #include "chrome/browser/supervised_user/supervised_user_constants.h"
19 #include "chrome/browser/supervised_user/supervised_user_refresh_token_fetcher.h " 19 #include "chrome/browser/supervised_user/supervised_user_refresh_token_fetcher.h "
20 #include "chrome/browser/supervised_user/supervised_user_shared_settings_service .h" 20 #include "chrome/browser/supervised_user/supervised_user_shared_settings_service .h"
21 #include "chrome/browser/supervised_user/supervised_user_shared_settings_service _factory.h" 21 #include "chrome/browser/supervised_user/supervised_user_shared_settings_service _factory.h"
22 #include "chrome/browser/supervised_user/supervised_user_shared_settings_update. h" 22 #include "chrome/browser/supervised_user/supervised_user_shared_settings_update. h"
23 #include "chrome/browser/supervised_user/supervised_user_sync_service.h" 23 #include "chrome/browser/supervised_user/supervised_user_sync_service.h"
24 #include "chrome/browser/supervised_user/supervised_user_sync_service_factory.h" 24 #include "chrome/browser/supervised_user/supervised_user_sync_service_factory.h"
25 #include "chrome/browser/sync/glue/device_info.h"
26 #include "chrome/common/chrome_switches.h" 25 #include "chrome/common/chrome_switches.h"
27 #include "chrome/common/pref_names.h" 26 #include "chrome/common/pref_names.h"
28 #include "components/signin/core/browser/profile_oauth2_token_service.h" 27 #include "components/signin/core/browser/profile_oauth2_token_service.h"
29 #include "components/signin/core/browser/signin_client.h" 28 #include "components/signin/core/browser/signin_client.h"
30 #include "components/signin/core/browser/signin_manager.h" 29 #include "components/signin/core/browser/signin_manager.h"
30 #include "content/public/browser/browser_thread.h"
31 #include "google_apis/gaia/gaia_urls.h" 31 #include "google_apis/gaia/gaia_urls.h"
32 #include "google_apis/gaia/google_service_auth_error.h" 32 #include "google_apis/gaia/google_service_auth_error.h"
33 #include "sync/util/get_session_name.h"
33 34
34 using base::DictionaryValue; 35 using base::DictionaryValue;
35 36
36 namespace { 37 namespace {
37 38
38 SupervisedUserRegistrationUtility* g_instance_for_tests = NULL; 39 SupervisedUserRegistrationUtility* g_instance_for_tests = NULL;
39 40
40 // Actual implementation of SupervisedUserRegistrationUtility. 41 // Actual implementation of SupervisedUserRegistrationUtility.
41 class SupervisedUserRegistrationUtilityImpl 42 class SupervisedUserRegistrationUtilityImpl
42 : public SupervisedUserRegistrationUtility, 43 : public SupervisedUserRegistrationUtility,
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 supervised_user_shared_settings_service_, 298 supervised_user_shared_settings_service_,
298 pending_supervised_user_id_, 299 pending_supervised_user_id_,
299 supervised_users::kChromeOSPasswordData, 300 supervised_users::kChromeOSPasswordData,
300 scoped_ptr<base::Value>(info.password_data.DeepCopy()), 301 scoped_ptr<base::Value>(info.password_data.DeepCopy()),
301 base::Bind( 302 base::Bind(
302 &SupervisedUserRegistrationUtilityImpl:: 303 &SupervisedUserRegistrationUtilityImpl::
303 OnPasswordChangeAcknowledged, 304 OnPasswordChangeAcknowledged,
304 weak_ptr_factory_.GetWeakPtr()))); 305 weak_ptr_factory_.GetWeakPtr())));
305 } 306 }
306 307
307 browser_sync::DeviceInfo::GetClientName( 308 syncer::GetSessionName(
309 content::BrowserThread::GetBlockingPool(),
308 base::Bind(&SupervisedUserRegistrationUtilityImpl::FetchToken, 310 base::Bind(&SupervisedUserRegistrationUtilityImpl::FetchToken,
309 weak_ptr_factory_.GetWeakPtr())); 311 weak_ptr_factory_.GetWeakPtr()));
310 } 312 }
311 313
312 void SupervisedUserRegistrationUtilityImpl::CancelPendingRegistration() { 314 void SupervisedUserRegistrationUtilityImpl::CancelPendingRegistration() {
313 AbortPendingRegistration( 315 AbortPendingRegistration(
314 false, // Don't run the callback. The error will be ignored. 316 false, // Don't run the callback. The error will be ignored.
315 GoogleServiceAuthError(GoogleServiceAuthError::NONE)); 317 GoogleServiceAuthError(GoogleServiceAuthError::NONE));
316 } 318 }
317 319
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 pending_supervised_user_id_); 408 pending_supervised_user_id_);
407 } 409 }
408 } 410 }
409 411
410 if (run_callback) 412 if (run_callback)
411 callback_.Run(error, pending_supervised_user_token_); 413 callback_.Run(error, pending_supervised_user_token_);
412 callback_.Reset(); 414 callback_.Reset();
413 } 415 }
414 416
415 } // namespace 417 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.cc ('k') | chrome/browser/sync/glue/device_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698