| 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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "chrome/browser/profiles/profile_attributes_storage.h" | 12 #include "chrome/browser/profiles/profile_attributes_storage.h" |
| 13 #include "chrome/browser/ui/webui/options/options_ui.h" | 13 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 14 #include "components/prefs/pref_change_registrar.h" | 14 #include "components/prefs/pref_change_registrar.h" |
| 15 #include "components/sync/driver/sync_service_observer.h" | 15 #include "components/sync/driver/sync_service_observer.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class StringValue; | 18 class StringValue; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace options { | 21 namespace options { |
| 22 | 22 |
| 23 // Chrome personal stuff profiles manage overlay UI handler. | 23 // Chrome personal stuff profiles manage overlay UI handler. |
| 24 class ManageProfileHandler : public OptionsPageUIHandler, | 24 class ManageProfileHandler : public OptionsPageUIHandler, |
| 25 public ProfileAttributesStorage::Observer, | 25 public ProfileAttributesStorage::Observer, |
| 26 public sync_driver::SyncServiceObserver { | 26 public syncer::SyncServiceObserver { |
| 27 public: | 27 public: |
| 28 ManageProfileHandler(); | 28 ManageProfileHandler(); |
| 29 ~ManageProfileHandler() override; | 29 ~ManageProfileHandler() override; |
| 30 | 30 |
| 31 // OptionsPageUIHandler: | 31 // OptionsPageUIHandler: |
| 32 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; | 32 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
| 33 void InitializeHandler() override; | 33 void InitializeHandler() override; |
| 34 void InitializePage() override; | 34 void InitializePage() override; |
| 35 void Uninitialize() override; | 35 void Uninitialize() override; |
| 36 | 36 |
| 37 // WebUIMessageHandler: | 37 // WebUIMessageHandler: |
| 38 void RegisterMessages() override; | 38 void RegisterMessages() override; |
| 39 | 39 |
| 40 // ProfileAttributesStorage::Observer: | 40 // ProfileAttributesStorage::Observer: |
| 41 void OnProfileAdded(const base::FilePath& profile_path) override; | 41 void OnProfileAdded(const base::FilePath& profile_path) override; |
| 42 void OnProfileWasRemoved(const base::FilePath& profile_path, | 42 void OnProfileWasRemoved(const base::FilePath& profile_path, |
| 43 const base::string16& profile_name) override; | 43 const base::string16& profile_name) override; |
| 44 void OnProfileNameChanged(const base::FilePath& profile_path, | 44 void OnProfileNameChanged(const base::FilePath& profile_path, |
| 45 const base::string16& old_profile_name) override; | 45 const base::string16& old_profile_name) override; |
| 46 void OnProfileAvatarChanged(const base::FilePath& profile_path) override; | 46 void OnProfileAvatarChanged(const base::FilePath& profile_path) override; |
| 47 | 47 |
| 48 // sync_driver::SyncServiceObserver: | 48 // syncer::SyncServiceObserver: |
| 49 void OnStateChanged() override; | 49 void OnStateChanged() override; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 // This function creates signed in user specific strings in loadTimeData. | 52 // This function creates signed in user specific strings in loadTimeData. |
| 53 void GenerateSignedinUserSpecificStrings(base::DictionaryValue* dictionary); | 53 void GenerateSignedinUserSpecificStrings(base::DictionaryValue* dictionary); |
| 54 | 54 |
| 55 // Callback for the "requestDefaultProfileIcons" message. | 55 // Callback for the "requestDefaultProfileIcons" message. |
| 56 // Sends the array of default profile icon URLs and profile names to WebUI. | 56 // Sends the array of default profile icon URLs and profile names to WebUI. |
| 57 // First item of |args| is the dialog mode, i.e. "create" or "manage". | 57 // First item of |args| is the dialog mode, i.e. "create" or "manage". |
| 58 void RequestDefaultProfileIcons(const base::ListValue* args); | 58 void RequestDefaultProfileIcons(const base::ListValue* args); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 // For generating weak pointers to itself for callbacks. | 136 // For generating weak pointers to itself for callbacks. |
| 137 base::WeakPtrFactory<ManageProfileHandler> weak_factory_; | 137 base::WeakPtrFactory<ManageProfileHandler> weak_factory_; |
| 138 | 138 |
| 139 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); | 139 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 } // namespace options | 142 } // namespace options |
| 143 | 143 |
| 144 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ | 144 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGE_PROFILE_HANDLER_H_ |
| OLD | NEW |