OLD | NEW |
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 web_ui()->RegisterMessageCallback("switchAppListProfile", | 175 web_ui()->RegisterMessageCallback("switchAppListProfile", |
176 base::Bind(&ManageProfileHandler::SwitchAppListProfile, | 176 base::Bind(&ManageProfileHandler::SwitchAppListProfile, |
177 base::Unretained(this))); | 177 base::Unretained(this))); |
178 #endif | 178 #endif |
179 web_ui()->RegisterMessageCallback("addProfileShortcut", | 179 web_ui()->RegisterMessageCallback("addProfileShortcut", |
180 base::Bind(&ManageProfileHandler::AddProfileShortcut, | 180 base::Bind(&ManageProfileHandler::AddProfileShortcut, |
181 base::Unretained(this))); | 181 base::Unretained(this))); |
182 web_ui()->RegisterMessageCallback("removeProfileShortcut", | 182 web_ui()->RegisterMessageCallback("removeProfileShortcut", |
183 base::Bind(&ManageProfileHandler::RemoveProfileShortcut, | 183 base::Bind(&ManageProfileHandler::RemoveProfileShortcut, |
184 base::Unretained(this))); | 184 base::Unretained(this))); |
| 185 web_ui()->RegisterMessageCallback("refreshGAIAPicture", |
| 186 base::Bind(&ManageProfileHandler::RefreshGAIAPicture, |
| 187 base::Unretained(this))); |
185 } | 188 } |
186 | 189 |
187 void ManageProfileHandler::Uninitialize() { | 190 void ManageProfileHandler::Uninitialize() { |
188 registrar_.RemoveAll(); | 191 registrar_.RemoveAll(); |
189 } | 192 } |
190 | 193 |
191 void ManageProfileHandler::Observe( | 194 void ManageProfileHandler::Observe( |
192 int type, | 195 int type, |
193 const content::NotificationSource& source, | 196 const content::NotificationSource& source, |
194 const content::NotificationDetails& details) { | 197 const content::NotificationDetails& details) { |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 ProfileShortcutManager* shortcut_manager = | 517 ProfileShortcutManager* shortcut_manager = |
515 g_browser_process->profile_manager()->profile_shortcut_manager(); | 518 g_browser_process->profile_manager()->profile_shortcut_manager(); |
516 DCHECK(shortcut_manager); | 519 DCHECK(shortcut_manager); |
517 | 520 |
518 shortcut_manager->RemoveProfileShortcuts(profile_file_path); | 521 shortcut_manager->RemoveProfileShortcuts(profile_file_path); |
519 | 522 |
520 // Update the UI buttons. | 523 // Update the UI buttons. |
521 OnHasProfileShortcuts(false); | 524 OnHasProfileShortcuts(false); |
522 } | 525 } |
523 | 526 |
| 527 void ManageProfileHandler::RefreshGAIAPicture(const base::ListValue* args) { |
| 528 profiles::UpdateGAIAProfilePhotoIfNeeded(Profile::FromWebUI(web_ui())); |
| 529 } |
| 530 |
524 } // namespace options | 531 } // namespace options |
OLD | NEW |