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

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

Issue 397543004: Enable syncing APPS and EXTENSIONS for supervised users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698