OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/webui/options/create_profile_handler.h" | 5 #include "chrome/browser/ui/webui/options/create_profile_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "base/value_conversions.h" | 12 #include "base/value_conversions.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
15 #include "chrome/browser/chromeos/login/wallpaper_manager.h" | |
15 #include "chrome/browser/managed_mode/managed_user_registration_utility.h" | 16 #include "chrome/browser/managed_mode/managed_user_registration_utility.h" |
16 #include "chrome/browser/managed_mode/managed_user_service.h" | 17 #include "chrome/browser/managed_mode/managed_user_service.h" |
17 #include "chrome/browser/managed_mode/managed_user_service_factory.h" | 18 #include "chrome/browser/managed_mode/managed_user_service_factory.h" |
18 #include "chrome/browser/managed_mode/managed_user_sync_service.h" | 19 #include "chrome/browser/managed_mode/managed_user_sync_service.h" |
19 #include "chrome/browser/managed_mode/managed_user_sync_service_factory.h" | 20 #include "chrome/browser/managed_mode/managed_user_sync_service_factory.h" |
20 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
21 #include "chrome/browser/profiles/profile_metrics.h" | 22 #include "chrome/browser/profiles/profile_metrics.h" |
22 #include "chrome/browser/profiles/profiles_state.h" | 23 #include "chrome/browser/profiles/profiles_state.h" |
23 #include "chrome/browser/sync/profile_sync_service.h" | 24 #include "chrome/browser/sync/profile_sync_service.h" |
24 #include "chrome/browser/sync/profile_sync_service_factory.h" | 25 #include "chrome/browser/sync/profile_sync_service_factory.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 } | 165 } |
165 | 166 |
166 void CreateProfileHandler::HandleProfileCreationSuccess( | 167 void CreateProfileHandler::HandleProfileCreationSuccess( |
167 bool create_shortcut, | 168 bool create_shortcut, |
168 chrome::HostDesktopType desktop_type, | 169 chrome::HostDesktopType desktop_type, |
169 const std::string& managed_user_id, | 170 const std::string& managed_user_id, |
170 Profile* profile) { | 171 Profile* profile) { |
171 switch (profile_creation_type_) { | 172 switch (profile_creation_type_) { |
172 case NON_SUPERVISED_PROFILE_CREATION: { | 173 case NON_SUPERVISED_PROFILE_CREATION: { |
173 DCHECK(managed_user_id.empty()); | 174 DCHECK(managed_user_id.empty()); |
175 // New profiles will have surprise me wallpaper enabled. | |
176 chromeos::WallpaperManager::Get()->EnableSurpriseMe(); | |
Nikita (slow)
2014/02/28 10:44:14
CreateProfileHandler is created only when chrome:/
| |
174 CreateShortcutAndShowSuccess(create_shortcut, desktop_type, profile); | 177 CreateShortcutAndShowSuccess(create_shortcut, desktop_type, profile); |
175 break; | 178 break; |
176 } | 179 } |
177 case SUPERVISED_PROFILE_CREATION: | 180 case SUPERVISED_PROFILE_CREATION: |
178 case SUPERVISED_PROFILE_IMPORT: | 181 case SUPERVISED_PROFILE_IMPORT: |
179 RegisterManagedUser(create_shortcut, desktop_type, | 182 RegisterManagedUser(create_shortcut, desktop_type, |
180 managed_user_id, profile); | 183 managed_user_id, profile); |
181 break; | 184 break; |
182 case NO_CREATION_IN_PROGRESS: | 185 case NO_CREATION_IN_PROGRESS: |
183 NOTREACHED(); | 186 NOTREACHED(); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
427 const ProfileInfoCache& cache = | 430 const ProfileInfoCache& cache = |
428 g_browser_process->profile_manager()->GetProfileInfoCache(); | 431 g_browser_process->profile_manager()->GetProfileInfoCache(); |
429 for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { | 432 for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { |
430 if (existing_managed_user_id == cache.GetManagedUserIdOfProfileAtIndex(i)) | 433 if (existing_managed_user_id == cache.GetManagedUserIdOfProfileAtIndex(i)) |
431 return false; | 434 return false; |
432 } | 435 } |
433 return true; | 436 return true; |
434 } | 437 } |
435 | 438 |
436 } // namespace options | 439 } // namespace options |
OLD | NEW |