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 "apps/app_window.h" | 5 #include "apps/app_window.h" |
6 #include "apps/app_window_registry.h" | 6 #include "apps/app_window_registry.h" |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
10 #include "chrome/browser/profiles/profile_metrics.h" | 10 #include "chrome/browser/profiles/profile_metrics.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 profiles::FindOrCreateNewWindowForProfile( | 44 profiles::FindOrCreateNewWindowForProfile( |
45 profile, | 45 profile, |
46 chrome::startup::IS_PROCESS_STARTUP, | 46 chrome::startup::IS_PROCESS_STARTUP, |
47 chrome::startup::IS_FIRST_RUN, | 47 chrome::startup::IS_FIRST_RUN, |
48 desktop_type, | 48 desktop_type, |
49 false); | 49 false); |
50 } | 50 } |
51 | 51 |
52 void DeleteProfileAtPath(base::FilePath file_path, content::WebUI* web_ui) { | 52 void DeleteProfileAtPath(base::FilePath file_path, content::WebUI* web_ui) { |
53 DCHECK(web_ui); | 53 DCHECK(web_ui); |
54 // This handler could have been called in managed mode, for example because | 54 // This handler could have been called for a supervised user, for example |
55 // the user fiddled with the web inspector. Silently return in this case. | 55 // because the user fiddled with the web inspector. Silently return in this |
56 if (Profile::FromWebUI(web_ui)->IsManaged()) | 56 // case. |
| 57 if (Profile::FromWebUI(web_ui)->IsSupervised()) |
57 return; | 58 return; |
58 | 59 |
59 if (!profiles::IsMultipleProfilesEnabled()) | 60 if (!profiles::IsMultipleProfilesEnabled()) |
60 return; | 61 return; |
61 | 62 |
62 ProfileMetrics::LogProfileDeleteUser(ProfileMetrics::PROFILE_DELETED); | 63 ProfileMetrics::LogProfileDeleteUser(ProfileMetrics::PROFILE_DELETED); |
63 | 64 |
64 g_browser_process->profile_manager()->ScheduleProfileForDeletion( | 65 g_browser_process->profile_manager()->ScheduleProfileForDeletion( |
65 file_path, | 66 file_path, |
66 base::Bind(&OpenNewWindowForProfile, GetDesktopType(web_ui))); | 67 base::Bind(&OpenNewWindowForProfile, GetDesktopType(web_ui))); |
67 } | 68 } |
68 | 69 |
69 } // namespace helper | 70 } // namespace helper |
70 } // namespace options | 71 } // namespace options |
71 | 72 |
72 | 73 |
OLD | NEW |