OLD | NEW |
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 if (type == chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED) | 59 if (type == chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED) |
60 SendProfileNames(); | 60 SendProfileNames(); |
61 else | 61 else |
62 OptionsPageUIHandler::Observe(type, source, details); | 62 OptionsPageUIHandler::Observe(type, source, details); |
63 } | 63 } |
64 | 64 |
65 void ManageProfileHandler::InitializeDefaultProfileIcons() { | 65 void ManageProfileHandler::InitializeDefaultProfileIcons() { |
66 ListValue image_url_list; | 66 ListValue image_url_list; |
67 for (size_t i = 0; i < ProfileInfoCache::GetDefaultAvatarIconCount(); i++) { | 67 for (size_t i = 0; i < ProfileInfoCache::GetDefaultAvatarIconCount(); i++) { |
68 std::string url = ProfileInfoCache::GetDefaultAvatarIconUrl(i); | 68 std::string url = ProfileInfoCache::GetDefaultAvatarIconUrl(i); |
69 image_url_list.Append(Value::CreateStringValue(url)); | 69 image_url_list.Append(base::StringValue::New(url)); |
70 } | 70 } |
71 | 71 |
72 web_ui_->CallJavascriptFunction( | 72 web_ui_->CallJavascriptFunction( |
73 "ManageProfileOverlay.receiveDefaultProfileIcons", | 73 "ManageProfileOverlay.receiveDefaultProfileIcons", |
74 image_url_list); | 74 image_url_list); |
75 } | 75 } |
76 | 76 |
77 void ManageProfileHandler::SendProfileNames() { | 77 void ManageProfileHandler::SendProfileNames() { |
78 ProfileInfoCache& cache = | 78 ProfileInfoCache& cache = |
79 g_browser_process->profile_manager()->GetProfileInfoCache(); | 79 g_browser_process->profile_manager()->GetProfileInfoCache(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 Value* file_path_value; | 118 Value* file_path_value; |
119 FilePath profile_file_path; | 119 FilePath profile_file_path; |
120 if (!args->Get(0, &file_path_value) || | 120 if (!args->Get(0, &file_path_value) || |
121 !base::GetValueAsFilePath(*file_path_value, &profile_file_path)) | 121 !base::GetValueAsFilePath(*file_path_value, &profile_file_path)) |
122 return; | 122 return; |
123 | 123 |
124 g_browser_process->profile_manager()->ScheduleProfileForDeletion( | 124 g_browser_process->profile_manager()->ScheduleProfileForDeletion( |
125 profile_file_path); | 125 profile_file_path); |
126 } | 126 } |
127 | 127 |
OLD | NEW |