| 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 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/profiles/profile_manager.h" | 22 #include "chrome/browser/profiles/profile_manager.h" |
| 23 #include "chrome/browser/profiles/profile_metrics.h" | 23 #include "chrome/browser/profiles/profile_metrics.h" |
| 24 #include "chrome/browser/profiles/profile_shortcut_manager.h" | 24 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
| 25 #include "chrome/browser/profiles/profile_window.h" | 25 #include "chrome/browser/profiles/profile_window.h" |
| 26 #include "chrome/browser/profiles/profiles_state.h" | 26 #include "chrome/browser/profiles/profiles_state.h" |
| 27 #include "chrome/browser/signin/signin_manager_factory.h" | 27 #include "chrome/browser/signin/signin_manager_factory.h" |
| 28 #include "chrome/browser/sync/profile_sync_service.h" | 28 #include "chrome/browser/sync/profile_sync_service.h" |
| 29 #include "chrome/browser/sync/profile_sync_service_factory.h" | 29 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 30 #include "chrome/browser/ui/browser_finder.h" | 30 #include "chrome/browser/ui/browser_finder.h" |
| 31 #include "chrome/browser/ui/webui/options/options_handlers_helper.h" | 31 #include "chrome/browser/ui/webui/options/options_handlers_helper.h" |
| 32 #include "chrome/common/chrome_switches.h" | |
| 33 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
| 34 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
| 35 #include "components/signin/core/browser/signin_manager.h" | 34 #include "components/signin/core/browser/signin_manager.h" |
| 36 #include "content/public/browser/browser_thread.h" | 35 #include "content/public/browser/browser_thread.h" |
| 37 #include "content/public/browser/notification_service.h" | 36 #include "content/public/browser/notification_service.h" |
| 38 #include "content/public/browser/web_ui.h" | 37 #include "content/public/browser/web_ui.h" |
| 39 #include "grit/generated_resources.h" | 38 #include "grit/generated_resources.h" |
| 40 #include "grit/google_chrome_strings.h" | 39 #include "grit/google_chrome_strings.h" |
| 41 #include "ui/base/l10n/l10n_util.h" | 40 #include "ui/base/l10n/l10n_util.h" |
| 42 #include "ui/base/webui/web_ui_util.h" | 41 #include "ui/base/webui/web_ui_util.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 123 |
| 125 RegisterStrings(localized_strings, resources, arraysize(resources)); | 124 RegisterStrings(localized_strings, resources, arraysize(resources)); |
| 126 RegisterTitle(localized_strings, "manageProfile", | 125 RegisterTitle(localized_strings, "manageProfile", |
| 127 IDS_PROFILES_MANAGE_TITLE); | 126 IDS_PROFILES_MANAGE_TITLE); |
| 128 RegisterTitle(localized_strings, "createProfile", | 127 RegisterTitle(localized_strings, "createProfile", |
| 129 IDS_PROFILES_CREATE_TITLE); | 128 IDS_PROFILES_CREATE_TITLE); |
| 130 | 129 |
| 131 localized_strings->SetBoolean("profileShortcutsEnabled", | 130 localized_strings->SetBoolean("profileShortcutsEnabled", |
| 132 ProfileShortcutManager::IsFeatureEnabled()); | 131 ProfileShortcutManager::IsFeatureEnabled()); |
| 133 | 132 |
| 134 localized_strings->SetBoolean( | |
| 135 "disableCreateExistingManagedUsers", | |
| 136 CommandLine::ForCurrentProcess()->HasSwitch( | |
| 137 switches::kDisableCreateExistingManagedUsers)); | |
| 138 | |
| 139 localized_strings->SetString("enterpriseManagedAccountHelpURL", | 133 localized_strings->SetString("enterpriseManagedAccountHelpURL", |
| 140 chrome::kEnterpriseManagedAccountHelpURL); | 134 chrome::kEnterpriseManagedAccountHelpURL); |
| 141 } | 135 } |
| 142 | 136 |
| 143 void ManageProfileHandler::InitializeHandler() { | 137 void ManageProfileHandler::InitializeHandler() { |
| 144 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, | 138 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, |
| 145 content::NotificationService::AllSources()); | 139 content::NotificationService::AllSources()); |
| 146 | 140 |
| 147 Profile* profile = Profile::FromWebUI(web_ui()); | 141 Profile* profile = Profile::FromWebUI(web_ui()); |
| 148 pref_change_registrar_.Init(profile->GetPrefs()); | 142 pref_change_registrar_.Init(profile->GetPrefs()); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 g_browser_process->profile_manager()->profile_shortcut_manager(); | 479 g_browser_process->profile_manager()->profile_shortcut_manager(); |
| 486 DCHECK(shortcut_manager); | 480 DCHECK(shortcut_manager); |
| 487 | 481 |
| 488 shortcut_manager->RemoveProfileShortcuts(profile_file_path); | 482 shortcut_manager->RemoveProfileShortcuts(profile_file_path); |
| 489 | 483 |
| 490 // Update the UI buttons. | 484 // Update the UI buttons. |
| 491 OnHasProfileShortcuts(false); | 485 OnHasProfileShortcuts(false); |
| 492 } | 486 } |
| 493 | 487 |
| 494 } // namespace options | 488 } // namespace options |
| OLD | NEW |