OLD | NEW |
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_service.h" | 5 #include "chrome/browser/supervised_user/supervised_user_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 } | 374 } |
375 | 375 |
376 void SupervisedUserService::FinishSetupSync() { | 376 void SupervisedUserService::FinishSetupSync() { |
377 ProfileSyncService* service = | 377 ProfileSyncService* service = |
378 ProfileSyncServiceFactory::GetForProfile(profile_); | 378 ProfileSyncServiceFactory::GetForProfile(profile_); |
379 DCHECK(service->sync_initialized()); | 379 DCHECK(service->sync_initialized()); |
380 | 380 |
381 bool sync_everything = false; | 381 bool sync_everything = false; |
382 syncer::ModelTypeSet synced_datatypes; | 382 syncer::ModelTypeSet synced_datatypes; |
383 synced_datatypes.Put(syncer::SESSIONS); | 383 synced_datatypes.Put(syncer::SESSIONS); |
| 384 synced_datatypes.Put(syncer::APPS); |
| 385 synced_datatypes.Put(syncer::EXTENSIONS); |
384 service->OnUserChoseDatatypes(sync_everything, synced_datatypes); | 386 service->OnUserChoseDatatypes(sync_everything, synced_datatypes); |
385 | 387 |
386 // Notify ProfileSyncService that we are done with configuration. | 388 // Notify ProfileSyncService that we are done with configuration. |
387 service->SetSetupInProgress(false); | 389 service->SetSetupInProgress(false); |
388 service->SetSyncSetupCompleted(); | 390 service->SetSyncSetupCompleted(); |
389 } | 391 } |
390 | 392 |
391 #if defined(ENABLE_EXTENSIONS) | 393 #if defined(ENABLE_EXTENSIONS) |
392 bool SupervisedUserService::ExtensionManagementPolicyImpl( | 394 bool SupervisedUserService::ExtensionManagementPolicyImpl( |
393 const extensions::Extension* extension, | 395 const extensions::Extension* extension, |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 | 765 |
764 void SupervisedUserService::OnBrowserSetLastActive(Browser* browser) { | 766 void SupervisedUserService::OnBrowserSetLastActive(Browser* browser) { |
765 bool profile_became_active = profile_->IsSameProfile(browser->profile()); | 767 bool profile_became_active = profile_->IsSameProfile(browser->profile()); |
766 if (!is_profile_active_ && profile_became_active) | 768 if (!is_profile_active_ && profile_became_active) |
767 content::RecordAction(UserMetricsAction("ManagedUsers_OpenProfile")); | 769 content::RecordAction(UserMetricsAction("ManagedUsers_OpenProfile")); |
768 else if (is_profile_active_ && !profile_became_active) | 770 else if (is_profile_active_ && !profile_became_active) |
769 content::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); | 771 content::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); |
770 | 772 |
771 is_profile_active_ = profile_became_active; | 773 is_profile_active_ = profile_became_active; |
772 } | 774 } |
OLD | NEW |