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

Side by Side Diff: chrome/browser/ui/webui/options/manage_profile_handler.cc

Issue 7845004: [Multi Profile] Don't allow the user to choose an empty profile name. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 3 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "base/value_conversions.h" 9 #include "base/value_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 12 matching lines...) Expand all
23 23
24 void ManageProfileHandler::GetLocalizedValues( 24 void ManageProfileHandler::GetLocalizedValues(
25 DictionaryValue* localized_strings) { 25 DictionaryValue* localized_strings) {
26 DCHECK(localized_strings); 26 DCHECK(localized_strings);
27 27
28 static OptionsStringResource resources[] = { 28 static OptionsStringResource resources[] = {
29 { "manageProfilesTitle", IDS_PROFILES_MANAGE_TITLE }, 29 { "manageProfilesTitle", IDS_PROFILES_MANAGE_TITLE },
30 { "manageProfilesNameLabel", IDS_PROFILES_MANAGE_NAME_LABEL }, 30 { "manageProfilesNameLabel", IDS_PROFILES_MANAGE_NAME_LABEL },
31 { "manageProfilesDuplicateNameError", 31 { "manageProfilesDuplicateNameError",
32 IDS_PROFILES_MANAGE_DUPLICATE_NAME_ERROR }, 32 IDS_PROFILES_MANAGE_DUPLICATE_NAME_ERROR },
33 { "manageProfilesEmptyNameError", IDS_PROFILES_MANAGE_EMPTY_NAME_ERROR },
33 { "manageProfilesIconLabel", IDS_PROFILES_MANAGE_ICON_LABEL }, 34 { "manageProfilesIconLabel", IDS_PROFILES_MANAGE_ICON_LABEL },
34 { "deleteProfileTitle", IDS_PROFILES_DELETE_TITLE }, 35 { "deleteProfileTitle", IDS_PROFILES_DELETE_TITLE },
35 { "deleteProfileOK", IDS_PROFILES_DELETE_OK_BUTTON_LABEL }, 36 { "deleteProfileOK", IDS_PROFILES_DELETE_OK_BUTTON_LABEL },
36 { "deleteProfileMessage", IDS_PROFILES_DELETE_MESSAGE }, 37 { "deleteProfileMessage", IDS_PROFILES_DELETE_MESSAGE },
37 }; 38 };
38 39
39 RegisterStrings(localized_strings, resources, arraysize(resources)); 40 RegisterStrings(localized_strings, resources, arraysize(resources));
40 } 41 }
41 42
42 void ManageProfileHandler::Initialize() { 43 void ManageProfileHandler::Initialize() {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 Value* file_path_value; 119 Value* file_path_value;
119 FilePath profile_file_path; 120 FilePath profile_file_path;
120 if (!args->Get(0, &file_path_value) || 121 if (!args->Get(0, &file_path_value) ||
121 !base::GetValueAsFilePath(*file_path_value, &profile_file_path)) 122 !base::GetValueAsFilePath(*file_path_value, &profile_file_path))
122 return; 123 return;
123 124
124 g_browser_process->profile_manager()->ScheduleProfileForDeletion( 125 g_browser_process->profile_manager()->ScheduleProfileForDeletion(
125 profile_file_path); 126 profile_file_path);
126 } 127 }
127 128
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698