| 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" |
| 11 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 11 #include "chrome/browser/profiles/profile_attributes_storage.h" |
| 12 #include "chrome/browser/ui/webui/settings/md_settings_ui.h" | 12 #include "chrome/browser/ui/webui/settings/md_settings_ui.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class StringValue; | 15 class StringValue; |
| 16 } | 16 } |
| 17 | 17 |
| 18 class Profile; | 18 class Profile; |
| 19 | 19 |
| 20 namespace settings { | 20 namespace settings { |
| 21 | 21 |
| 22 // Chrome personal stuff profiles manage overlay UI handler. | 22 // Chrome personal stuff profiles manage overlay UI handler. |
| 23 class ManageProfileHandler : public settings::SettingsPageUIHandler, | 23 class ManageProfileHandler : public settings::SettingsPageUIHandler, |
| 24 public ProfileInfoCacheObserver { | 24 public ProfileAttributesStorage::Observer { |
| 25 public: | 25 public: |
| 26 explicit ManageProfileHandler(Profile* profile); | 26 explicit ManageProfileHandler(Profile* profile); |
| 27 ~ManageProfileHandler() override; | 27 ~ManageProfileHandler() override; |
| 28 | 28 |
| 29 // settings::SettingsPageUIHandler: | 29 // settings::SettingsPageUIHandler: |
| 30 void RegisterMessages() override; | 30 void RegisterMessages() override; |
| 31 | 31 |
| 32 // ProfileInfoCacheObserver: | 32 // ProfileAttributesStorage::Observer: |
| 33 void OnProfileNameChanged(const base::FilePath& profile_path, | 33 void OnProfileNameChanged(const base::FilePath& profile_path, |
| 34 const base::string16& old_profile_name) override; | 34 const base::string16& old_profile_name) override; |
| 35 void OnProfileAvatarChanged(const base::FilePath& profile_path) override; | 35 void OnProfileAvatarChanged(const base::FilePath& profile_path) override; |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 // Callback for the "requestDefaultProfileIcons" message. | 38 // Callback for the "requestDefaultProfileIcons" message. |
| 39 // Sends the array of default profile icon URLs and profile names to WebUI. | 39 // Sends the array of default profile icon URLs and profile names to WebUI. |
| 40 // First item of |args| is the dialog mode, i.e. "create" or "manage". | 40 // First item of |args| is the dialog mode, i.e. "create" or "manage". |
| 41 void RequestDefaultProfileIcons(const base::ListValue* args); | 41 void RequestDefaultProfileIcons(const base::ListValue* args); |
| 42 | 42 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 // For generating weak pointers to itself for callbacks. | 89 // For generating weak pointers to itself for callbacks. |
| 90 base::WeakPtrFactory<ManageProfileHandler> weak_factory_; | 90 base::WeakPtrFactory<ManageProfileHandler> weak_factory_; |
| 91 | 91 |
| 92 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); | 92 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 } // namespace settings | 95 } // namespace settings |
| 96 | 96 |
| 97 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_ | 97 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_ |
| OLD | NEW |