OLD | NEW |
1 // Copyright (c) 2012 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/options2/manage_profile_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/manage_profile_handler2.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" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 }; | 47 }; |
48 | 48 |
49 RegisterStrings(localized_strings, resources, arraysize(resources)); | 49 RegisterStrings(localized_strings, resources, arraysize(resources)); |
50 RegisterTitle(localized_strings, "manageProfile", | 50 RegisterTitle(localized_strings, "manageProfile", |
51 IDS_PROFILES_MANAGE_TITLE); | 51 IDS_PROFILES_MANAGE_TITLE); |
52 } | 52 } |
53 | 53 |
54 void ManageProfileHandler::Initialize() { | 54 void ManageProfileHandler::Initialize() { |
55 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, | 55 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, |
56 content::NotificationService::AllSources()); | 56 content::NotificationService::AllSources()); |
| 57 } |
| 58 |
| 59 void ManageProfileHandler::SendPageValues() { |
57 SendProfileNames(); | 60 SendProfileNames(); |
58 } | 61 } |
59 | 62 |
60 void ManageProfileHandler::RegisterMessages() { | 63 void ManageProfileHandler::RegisterMessages() { |
61 web_ui()->RegisterMessageCallback("setProfileNameAndIcon", | 64 web_ui()->RegisterMessageCallback("setProfileNameAndIcon", |
62 base::Bind(&ManageProfileHandler::SetProfileNameAndIcon, | 65 base::Bind(&ManageProfileHandler::SetProfileNameAndIcon, |
63 base::Unretained(this))); | 66 base::Unretained(this))); |
64 web_ui()->RegisterMessageCallback("deleteProfile", | 67 web_ui()->RegisterMessageCallback("deleteProfile", |
65 base::Bind(&ManageProfileHandler::DeleteProfile, | 68 base::Bind(&ManageProfileHandler::DeleteProfile, |
66 base::Unretained(this))); | 69 base::Unretained(this))); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 string16 gaia_name = cache.GetGAIANameOfProfileAtIndex(i); | 305 string16 gaia_name = cache.GetGAIANameOfProfileAtIndex(i); |
303 if (gaia_name.empty()) | 306 if (gaia_name.empty()) |
304 return; | 307 return; |
305 | 308 |
306 StringValue gaia_name_value(gaia_name); | 309 StringValue gaia_name_value(gaia_name); |
307 web_ui()->CallJavascriptFunction("ManageProfileOverlay.setProfileName", | 310 web_ui()->CallJavascriptFunction("ManageProfileOverlay.setProfileName", |
308 gaia_name_value); | 311 gaia_name_value); |
309 } | 312 } |
310 | 313 |
311 } // namespace options2 | 314 } // namespace options2 |
OLD | NEW |