Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: chrome/browser/ui/webui/signin/signin_create_profile_handler.cc

Issue 2498153002: [MD Settings][MD User Manager] create/manage profile desktop shortcut (Windows only) (Closed)
Patch Set: Addressed comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/signin/signin_create_profile_handler.h" 5 #include "chrome/browser/ui/webui/signin/signin_create_profile_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // Cancellation is only supported for supervised users. 66 // Cancellation is only supported for supervised users.
67 CancelProfileRegistration(false); 67 CancelProfileRegistration(false);
68 #endif 68 #endif
69 g_browser_process->profile_manager()-> 69 g_browser_process->profile_manager()->
70 GetProfileAttributesStorage().RemoveObserver(this); 70 GetProfileAttributesStorage().RemoveObserver(this);
71 } 71 }
72 72
73 void SigninCreateProfileHandler::GetLocalizedValues( 73 void SigninCreateProfileHandler::GetLocalizedValues(
74 base::DictionaryValue* localized_strings) { 74 base::DictionaryValue* localized_strings) {
75 localized_strings->SetString( 75 localized_strings->SetString(
76 "createDesktopShortcutLabel",
77 l10n_util::GetStringUTF16(
78 IDS_PROFILES_CREATE_DESKTOP_SHORTCUT_LABEL));
79 localized_strings->SetString(
76 "manageProfilesSupervisedSignedInLabel", 80 "manageProfilesSupervisedSignedInLabel",
77 l10n_util::GetStringUTF16( 81 l10n_util::GetStringUTF16(
78 IDS_PROFILES_CREATE_SUPERVISED_MULTI_SIGNED_IN_LABEL)); 82 IDS_PROFILES_CREATE_SUPERVISED_MULTI_SIGNED_IN_LABEL));
79 localized_strings->SetString( 83 localized_strings->SetString(
80 "noSignedInUserMessage", 84 "noSignedInUserMessage",
81 l10n_util::GetStringUTF16( 85 l10n_util::GetStringUTF16(
82 IDS_PROFILES_CREATE_SUPERVISED_NO_SIGNED_IN_USER_TEXT)); 86 IDS_PROFILES_CREATE_SUPERVISED_NO_SIGNED_IN_USER_TEXT));
83 localized_strings->SetString("createProfileConfirm", 87 localized_strings->SetString("createProfileConfirm",
84 l10n_util::GetStringUTF16(IDS_SAVE)); 88 l10n_util::GetStringUTF16(IDS_SAVE));
85 localized_strings->SetString("learnMore", 89 localized_strings->SetString("learnMore",
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 NOTREACHED(); 351 NOTREACHED();
348 break; 352 break;
349 } 353 }
350 } 354 }
351 355
352 void SigninCreateProfileHandler::CreateShortcutAndShowSuccess( 356 void SigninCreateProfileHandler::CreateShortcutAndShowSuccess(
353 bool create_shortcut, 357 bool create_shortcut,
354 Profile* custodian_profile, 358 Profile* custodian_profile,
355 Profile* profile) { 359 Profile* profile) {
356 if (create_shortcut) { 360 if (create_shortcut) {
361 DCHECK(ProfileShortcutManager::IsFeatureEnabled());
357 ProfileShortcutManager* shortcut_manager = 362 ProfileShortcutManager* shortcut_manager =
358 g_browser_process->profile_manager()->profile_shortcut_manager(); 363 g_browser_process->profile_manager()->profile_shortcut_manager();
359 364 DCHECK(shortcut_manager);
360 if (shortcut_manager) 365 if (shortcut_manager)
361 shortcut_manager->CreateProfileShortcut(profile->GetPath()); 366 shortcut_manager->CreateProfileShortcut(profile->GetPath());
362 } 367 }
363 368
364 DCHECK_EQ(profile_path_being_created_.value(), profile->GetPath().value()); 369 DCHECK_EQ(profile_path_being_created_.value(), profile->GetPath().value());
365 profile_path_being_created_.clear(); 370 profile_path_being_created_.clear();
366 DCHECK_NE(NO_CREATION_IN_PROGRESS, profile_creation_type_); 371 DCHECK_NE(NO_CREATION_IN_PROGRESS, profile_creation_type_);
367 base::DictionaryValue dict; 372 base::DictionaryValue dict;
368 dict.SetString("name", profile->GetPrefs()->GetString(prefs::kProfileName)); 373 dict.SetString("name", profile->GetPrefs()->GetString(prefs::kProfileName));
369 dict.Set("filePath", base::CreateFilePathValue(profile->GetPath())); 374 dict.Set("filePath", base::CreateFilePathValue(profile->GetPath()));
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 808
804 profiles::OpenBrowserWindowForProfile( 809 profiles::OpenBrowserWindowForProfile(
805 base::Bind(&SigninCreateProfileHandler::OnBrowserReadyCallback, 810 base::Bind(&SigninCreateProfileHandler::OnBrowserReadyCallback,
806 weak_ptr_factory_.GetWeakPtr()), 811 weak_ptr_factory_.GetWeakPtr()),
807 false, // Don't create a window if one already exists. 812 false, // Don't create a window if one already exists.
808 true, // Create a first run window. 813 true, // Create a first run window.
809 profile, 814 profile,
810 Profile::CREATE_STATUS_INITIALIZED); 815 Profile::CREATE_STATUS_INITIALIZED);
811 } 816 }
812 #endif 817 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/signin/md_user_manager_ui.cc ('k') | chrome/test/data/webui/md_user_manager/create_profile_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698