OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "base/value_conversions.h" | 11 #include "base/value_conversions.h" |
(...skipping 30 matching lines...) Expand all Loading... |
42 IDS_PROFILES_MANAGE_DUPLICATE_NAME_ERROR }, | 42 IDS_PROFILES_MANAGE_DUPLICATE_NAME_ERROR }, |
43 { "manageProfilesIconLabel", IDS_PROFILES_MANAGE_ICON_LABEL }, | 43 { "manageProfilesIconLabel", IDS_PROFILES_MANAGE_ICON_LABEL }, |
44 { "deleteProfileTitle", IDS_PROFILES_DELETE_TITLE }, | 44 { "deleteProfileTitle", IDS_PROFILES_DELETE_TITLE }, |
45 { "deleteProfileOK", IDS_PROFILES_DELETE_OK_BUTTON_LABEL }, | 45 { "deleteProfileOK", IDS_PROFILES_DELETE_OK_BUTTON_LABEL }, |
46 { "deleteProfileMessage", IDS_PROFILES_DELETE_MESSAGE }, | 46 { "deleteProfileMessage", IDS_PROFILES_DELETE_MESSAGE }, |
47 }; | 47 }; |
48 | 48 |
49 RegisterStrings(localized_strings, resources, arraysize(resources)); | 49 RegisterStrings(localized_strings, resources, arraysize(resources)); |
50 } | 50 } |
51 | 51 |
52 void ManageProfileHandler::Initialize() { | 52 void ManageProfileHandler::InitializeHandler() { |
53 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, | 53 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, |
54 content::NotificationService::AllSources()); | 54 content::NotificationService::AllSources()); |
55 SendProfileNames(); | 55 SendProfileNames(); |
56 } | 56 } |
57 | 57 |
58 void ManageProfileHandler::RegisterMessages() { | 58 void ManageProfileHandler::RegisterMessages() { |
59 web_ui()->RegisterMessageCallback("setProfileNameAndIcon", | 59 web_ui()->RegisterMessageCallback("setProfileNameAndIcon", |
60 base::Bind(&ManageProfileHandler::SetProfileNameAndIcon, | 60 base::Bind(&ManageProfileHandler::SetProfileNameAndIcon, |
61 base::Unretained(this))); | 61 base::Unretained(this))); |
62 web_ui()->RegisterMessageCallback("deleteProfile", | 62 web_ui()->RegisterMessageCallback("deleteProfile", |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 if (i == std::string::npos) | 303 if (i == std::string::npos) |
304 return; | 304 return; |
305 string16 gaia_name = cache.GetGAIANameOfProfileAtIndex(i); | 305 string16 gaia_name = cache.GetGAIANameOfProfileAtIndex(i); |
306 if (gaia_name.empty()) | 306 if (gaia_name.empty()) |
307 return; | 307 return; |
308 | 308 |
309 StringValue gaia_name_value(gaia_name); | 309 StringValue gaia_name_value(gaia_name); |
310 web_ui()->CallJavascriptFunction("ManageProfileOverlay.setProfileName", | 310 web_ui()->CallJavascriptFunction("ManageProfileOverlay.setProfileName", |
311 gaia_name_value); | 311 gaia_name_value); |
312 } | 312 } |
OLD | NEW |