| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/manage_profile_handler.h" | 5 #include "chrome/browser/ui/webui/options/manage_profile_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 RegisterStrings(localized_strings, resources, arraysize(resources)); | 115 RegisterStrings(localized_strings, resources, arraysize(resources)); |
| 116 RegisterTitle(localized_strings, "manageProfile", | 116 RegisterTitle(localized_strings, "manageProfile", |
| 117 IDS_PROFILES_MANAGE_TITLE); | 117 IDS_PROFILES_MANAGE_TITLE); |
| 118 RegisterTitle(localized_strings, "createProfile", | 118 RegisterTitle(localized_strings, "createProfile", |
| 119 IDS_PROFILES_CREATE_TITLE); | 119 IDS_PROFILES_CREATE_TITLE); |
| 120 | 120 |
| 121 localized_strings->SetBoolean("profileShortcutsEnabled", | 121 localized_strings->SetBoolean("profileShortcutsEnabled", |
| 122 ProfileShortcutManager::IsFeatureEnabled()); | 122 ProfileShortcutManager::IsFeatureEnabled()); |
| 123 | 123 |
| 124 localized_strings->SetBoolean( | 124 localized_strings->SetBoolean( |
| 125 "allowCreateExistingManagedUsers", | 125 "disableCreateExistingManagedUsers", |
| 126 CommandLine::ForCurrentProcess()->HasSwitch( | 126 CommandLine::ForCurrentProcess()->HasSwitch( |
| 127 switches::kAllowCreateExistingManagedUsers)); | 127 switches::kDisableCreateExistingManagedUsers)); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void ManageProfileHandler::InitializeHandler() { | 130 void ManageProfileHandler::InitializeHandler() { |
| 131 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, | 131 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, |
| 132 content::NotificationService::AllSources()); | 132 content::NotificationService::AllSources()); |
| 133 | 133 |
| 134 Profile* profile = Profile::FromWebUI(web_ui()); | 134 Profile* profile = Profile::FromWebUI(web_ui()); |
| 135 pref_change_registrar_.Init(profile->GetPrefs()); | 135 pref_change_registrar_.Init(profile->GetPrefs()); |
| 136 pref_change_registrar_.Add( | 136 pref_change_registrar_.Add( |
| 137 prefs::kManagedUserCreationAllowed, | 137 prefs::kManagedUserCreationAllowed, |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 g_browser_process->profile_manager()->profile_shortcut_manager(); | 465 g_browser_process->profile_manager()->profile_shortcut_manager(); |
| 466 DCHECK(shortcut_manager); | 466 DCHECK(shortcut_manager); |
| 467 | 467 |
| 468 shortcut_manager->RemoveProfileShortcuts(profile_file_path); | 468 shortcut_manager->RemoveProfileShortcuts(profile_file_path); |
| 469 | 469 |
| 470 // Update the UI buttons. | 470 // Update the UI buttons. |
| 471 OnHasProfileShortcuts(false); | 471 OnHasProfileShortcuts(false); |
| 472 } | 472 } |
| 473 | 473 |
| 474 } // namespace options | 474 } // namespace options |
| OLD | NEW |