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

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

Issue 22267008: Use |GetDictinonary| instead of |DictionaryPrefUpdate| in |ManageProfileHandler::RequestExistingMan… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 Profile* profile = Profile::FromWebUI(web_ui()); 224 Profile* profile = Profile::FromWebUI(web_ui());
225 if (profile->IsManaged()) 225 if (profile->IsManaged())
226 return; 226 return;
227 227
228 const ProfileInfoCache& cache = 228 const ProfileInfoCache& cache =
229 g_browser_process->profile_manager()->GetProfileInfoCache(); 229 g_browser_process->profile_manager()->GetProfileInfoCache();
230 std::set<std::string> managed_user_ids; 230 std::set<std::string> managed_user_ids;
231 for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) 231 for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i)
232 managed_user_ids.insert(cache.GetManagedUserIdOfProfileAtIndex(i)); 232 managed_user_ids.insert(cache.GetManagedUserIdOfProfileAtIndex(i));
233 233
234 DictionaryValue* dict = 234 const DictionaryValue* dict =
235 DictionaryPrefUpdate(profile->GetPrefs(), prefs::kManagedUsers).Get(); 235 profile->GetPrefs()->GetDictionary(prefs::kManagedUsers);
236 DictionaryValue id_names_dict; 236 DictionaryValue id_names_dict;
237 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { 237 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) {
238 if (managed_user_ids.find(it.key()) != managed_user_ids.end()) 238 if (managed_user_ids.find(it.key()) != managed_user_ids.end())
239 continue; 239 continue;
240 const DictionaryValue* value = NULL; 240 const DictionaryValue* value = NULL;
241 bool success = it.value().GetAsDictionary(&value); 241 bool success = it.value().GetAsDictionary(&value);
242 DCHECK(success); 242 DCHECK(success);
243 std::string name; 243 std::string name;
244 value->GetString("name", &name); 244 value->GetString("name", &name);
245 id_names_dict.SetString(it.key(), name); 245 id_names_dict.SetString(it.key(), name);
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 g_browser_process->profile_manager()->profile_shortcut_manager(); 495 g_browser_process->profile_manager()->profile_shortcut_manager();
496 DCHECK(shortcut_manager); 496 DCHECK(shortcut_manager);
497 497
498 shortcut_manager->RemoveProfileShortcuts(profile_file_path); 498 shortcut_manager->RemoveProfileShortcuts(profile_file_path);
499 499
500 // Update the UI buttons. 500 // Update the UI buttons.
501 OnHasProfileShortcuts(false); 501 OnHasProfileShortcuts(false);
502 } 502 }
503 503
504 } // namespace options 504 } // namespace options
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698