OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/settings/settings_manage_profile_handler.h" | 5 #include "chrome/browser/ui/webui/settings/settings_manage_profile_handler.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 &g_browser_process->profile_manager()->GetProfileAttributesStorage()); | 91 &g_browser_process->profile_manager()->GetProfileAttributesStorage()); |
92 } | 92 } |
93 | 93 |
94 void ManageProfileHandler::OnJavascriptDisallowed() { | 94 void ManageProfileHandler::OnJavascriptDisallowed() { |
95 observer_.RemoveAll(); | 95 observer_.RemoveAll(); |
96 } | 96 } |
97 | 97 |
98 void ManageProfileHandler::OnProfileAvatarChanged( | 98 void ManageProfileHandler::OnProfileAvatarChanged( |
99 const base::FilePath& profile_path) { | 99 const base::FilePath& profile_path) { |
100 // This is necessary to send the potentially updated GAIA photo. | 100 // This is necessary to send the potentially updated GAIA photo. |
101 CallJavascriptFunction("cr.webUIListenerCallback", | 101 FireWebUIListener("available-icons-changed", *GetAvailableIcons()); |
102 base::Value("available-icons-changed"), | |
103 *GetAvailableIcons()); | |
104 } | 102 } |
105 | 103 |
106 void ManageProfileHandler::HandleGetAvailableIcons( | 104 void ManageProfileHandler::HandleGetAvailableIcons( |
107 const base::ListValue* args) { | 105 const base::ListValue* args) { |
108 AllowJavascript(); | 106 AllowJavascript(); |
109 | 107 |
110 profiles::UpdateGaiaProfileInfoIfNeeded(profile_); | 108 profiles::UpdateGaiaProfileInfoIfNeeded(profile_); |
111 | 109 |
112 CHECK_EQ(1U, args->GetSize()); | 110 CHECK_EQ(1U, args->GetSize()); |
113 const base::Value* callback_id; | 111 const base::Value* callback_id; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 const base::ListValue* args) { | 248 const base::ListValue* args) { |
251 DCHECK(ProfileShortcutManager::IsFeatureEnabled()); | 249 DCHECK(ProfileShortcutManager::IsFeatureEnabled()); |
252 ProfileShortcutManager* shortcut_manager = | 250 ProfileShortcutManager* shortcut_manager = |
253 g_browser_process->profile_manager()->profile_shortcut_manager(); | 251 g_browser_process->profile_manager()->profile_shortcut_manager(); |
254 DCHECK(shortcut_manager); | 252 DCHECK(shortcut_manager); |
255 | 253 |
256 shortcut_manager->RemoveProfileShortcuts(profile_->GetPath()); | 254 shortcut_manager->RemoveProfileShortcuts(profile_->GetPath()); |
257 } | 255 } |
258 | 256 |
259 } // namespace settings | 257 } // namespace settings |
OLD | NEW |