| 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 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 explicit ManageProfileHandler(Profile* profile); | 27 explicit ManageProfileHandler(Profile* profile); |
| 28 ~ManageProfileHandler() override; | 28 ~ManageProfileHandler() override; |
| 29 | 29 |
| 30 // settings::SettingsPageUIHandler: | 30 // settings::SettingsPageUIHandler: |
| 31 void RegisterMessages() override; | 31 void RegisterMessages() override; |
| 32 | 32 |
| 33 // ProfileAttributesStorage::Observer: | 33 // ProfileAttributesStorage::Observer: |
| 34 void OnProfileAvatarChanged(const base::FilePath& profile_path) override; | 34 void OnProfileAvatarChanged(const base::FilePath& profile_path) override; |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 FRIEND_TEST_ALL_PREFIXES(ManageProfileHandlerTest, SetProfileIconAndName); | 37 FRIEND_TEST_ALL_PREFIXES(ManageProfileHandlerTest, |
| 38 FRIEND_TEST_ALL_PREFIXES(ManageProfileHandlerTest, GetAvailableIcons); | 38 HandleSetProfileIconAndName); |
| 39 FRIEND_TEST_ALL_PREFIXES(ManageProfileHandlerTest, HandleGetAvailableIcons); |
| 39 | 40 |
| 40 // Callback for the "getAvailableIcons" message. | 41 // Callback for the "getAvailableIcons" message. |
| 41 // Sends the array of default profile icon URLs and profile names to WebUI. | 42 // Sends the array of default profile icon URLs and profile names to WebUI. |
| 42 void HandleGetAvailableIcons(const base::ListValue* args); | 43 void HandleGetAvailableIcons(const base::ListValue* args); |
| 43 | 44 |
| 44 // Send all the available profile icons to choose from. | 45 // Get all the available profile icons to choose from. |
| 45 void SendAvailableIcons(); | 46 scoped_ptr<base::ListValue> GetAvailableIcons(); |
| 46 | 47 |
| 47 // Callback for the "setProfileIconAndName" message. Sets the name and icon | 48 // Callback for the "setProfileIconAndName" message. Sets the name and icon |
| 48 // of a given profile. | 49 // of a given profile. |
| 49 // |args| is of the form: [ | 50 // |args| is of the form: [ |
| 50 // /*string*/ newProfileIconURL | 51 // /*string*/ newProfileIconURL |
| 51 // /*string*/ newProfileName, | 52 // /*string*/ newProfileName, |
| 52 // ] | 53 // ] |
| 53 void HandleSetProfileIconAndName(const base::ListValue* args); | 54 void HandleSetProfileIconAndName(const base::ListValue* args); |
| 54 | 55 |
| 55 // Callback for the "requestHasProfileShortcuts" message, which is called | 56 // Callback for the "requestHasProfileShortcuts" message, which is called |
| (...skipping 27 matching lines...) Expand all Loading... |
| 83 | 84 |
| 84 // For generating weak pointers to itself for callbacks. | 85 // For generating weak pointers to itself for callbacks. |
| 85 base::WeakPtrFactory<ManageProfileHandler> weak_factory_; | 86 base::WeakPtrFactory<ManageProfileHandler> weak_factory_; |
| 86 | 87 |
| 87 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); | 88 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); |
| 88 }; | 89 }; |
| 89 | 90 |
| 90 } // namespace settings | 91 } // namespace settings |
| 91 | 92 |
| 92 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_ | 93 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_ |
| OLD | NEW |