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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 #include "ui/base/l10n/l10n_util.h" | 55 #include "ui/base/l10n/l10n_util.h" |
56 | 56 |
57 #if !defined(OS_ANDROID) | 57 #if !defined(OS_ANDROID) |
58 #include "chrome/browser/supervised_user/legacy/custodian_profile_downloader_ser
vice.h" | 58 #include "chrome/browser/supervised_user/legacy/custodian_profile_downloader_ser
vice.h" |
59 #include "chrome/browser/supervised_user/legacy/custodian_profile_downloader_ser
vice_factory.h" | 59 #include "chrome/browser/supervised_user/legacy/custodian_profile_downloader_ser
vice_factory.h" |
60 #include "chrome/browser/supervised_user/legacy/permission_request_creator_sync.
h" | 60 #include "chrome/browser/supervised_user/legacy/permission_request_creator_sync.
h" |
61 #include "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser
vice.h" | 61 #include "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser
vice.h" |
62 #include "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser
vice_factory.h" | 62 #include "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser
vice_factory.h" |
63 #include "chrome/browser/supervised_user/legacy/supervised_user_registration_uti
lity.h" | 63 #include "chrome/browser/supervised_user/legacy/supervised_user_registration_uti
lity.h" |
64 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service_factory.h" | 64 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service_factory.h" |
| 65 #include "chrome/browser/themes/theme_service.h" |
| 66 #include "chrome/browser/themes/theme_service_factory.h" |
65 #endif | 67 #endif |
66 | 68 |
67 #if defined(OS_CHROMEOS) | 69 #if defined(OS_CHROMEOS) |
68 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 70 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
69 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" | 71 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" |
70 #include "components/user_manager/user_manager.h" | 72 #include "components/user_manager/user_manager.h" |
71 #endif | 73 #endif |
72 | 74 |
73 #if BUILDFLAG(ENABLE_EXTENSIONS) | 75 #if BUILDFLAG(ENABLE_EXTENSIONS) |
74 #include "chrome/browser/extensions/extension_service.h" | 76 #include "chrome/browser/extensions/extension_service.h" |
75 #include "chrome/browser/extensions/extension_util.h" | 77 #include "chrome/browser/extensions/extension_util.h" |
76 #include "extensions/browser/extension_prefs.h" | 78 #include "extensions/browser/extension_prefs.h" |
77 #include "extensions/browser/extension_registry.h" | 79 #include "extensions/browser/extension_registry.h" |
78 #include "extensions/browser/extension_system.h" | 80 #include "extensions/browser/extension_system.h" |
79 #endif | 81 #endif |
80 | 82 |
81 #if defined(ENABLE_THEMES) | |
82 #include "chrome/browser/themes/theme_service.h" | |
83 #include "chrome/browser/themes/theme_service_factory.h" | |
84 #endif | |
85 | |
86 using base::DictionaryValue; | 83 using base::DictionaryValue; |
87 using base::UserMetricsAction; | 84 using base::UserMetricsAction; |
88 using content::BrowserThread; | 85 using content::BrowserThread; |
89 | 86 |
90 #if BUILDFLAG(ENABLE_EXTENSIONS) | 87 #if BUILDFLAG(ENABLE_EXTENSIONS) |
91 using extensions::Extension; | 88 using extensions::Extension; |
92 using extensions::ExtensionPrefs; | 89 using extensions::ExtensionPrefs; |
93 using extensions::ExtensionRegistry; | 90 using extensions::ExtensionRegistry; |
94 using extensions::ExtensionSystem; | 91 using extensions::ExtensionSystem; |
95 #endif | 92 #endif |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 | 578 |
582 SetupSync(); | 579 SetupSync(); |
583 #else | 580 #else |
584 NOTREACHED(); | 581 NOTREACHED(); |
585 #endif | 582 #endif |
586 } | 583 } |
587 } | 584 } |
588 | 585 |
589 // Now activate/deactivate anything not handled by the delegate yet. | 586 // Now activate/deactivate anything not handled by the delegate yet. |
590 | 587 |
591 #if defined(ENABLE_THEMES) | 588 #if !defined(OS_ANDROID) |
592 // Re-set the default theme to turn the SU theme on/off. | 589 // Re-set the default theme to turn the SU theme on/off. |
593 ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_); | 590 ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_); |
594 if (theme_service->UsingDefaultTheme() || theme_service->UsingSystemTheme()) | 591 if (theme_service->UsingDefaultTheme() || theme_service->UsingSystemTheme()) |
595 theme_service->UseDefaultTheme(); | 592 theme_service->UseDefaultTheme(); |
596 #endif | 593 #endif |
597 | 594 |
598 browser_sync::ProfileSyncService* sync_service = | 595 browser_sync::ProfileSyncService* sync_service = |
599 ProfileSyncServiceFactory::GetForProfile(profile_); | 596 ProfileSyncServiceFactory::GetForProfile(profile_); |
600 sync_service->SetEncryptEverythingAllowed(!active_); | 597 sync_service->SetEncryptEverythingAllowed(!active_); |
601 | 598 |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 content::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); | 1280 content::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); |
1284 | 1281 |
1285 is_profile_active_ = profile_became_active; | 1282 is_profile_active_ = profile_became_active; |
1286 } | 1283 } |
1287 #endif // !defined(OS_ANDROID) | 1284 #endif // !defined(OS_ANDROID) |
1288 | 1285 |
1289 void SupervisedUserService::OnSiteListUpdated() { | 1286 void SupervisedUserService::OnSiteListUpdated() { |
1290 for (SupervisedUserServiceObserver& observer : observer_list_) | 1287 for (SupervisedUserServiceObserver& observer : observer_list_) |
1291 observer.OnURLFilterChanged(); | 1288 observer.OnURLFilterChanged(); |
1292 } | 1289 } |
OLD | NEW |