OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SUPERVISED_USER_IMPORT_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_IMPORT_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_IMPORT_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_IMPORT_HANDLER_H_ |
7 | 7 |
8 #include "base/callback_list.h" | 8 #include "base/callback_list.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 // Handler for the 'import existing supervised user' dialog. | 22 // Handler for the 'import existing supervised user' dialog. |
23 class SupervisedUserImportHandler : public OptionsPageUIHandler, | 23 class SupervisedUserImportHandler : public OptionsPageUIHandler, |
24 public SupervisedUserSyncServiceObserver, | 24 public SupervisedUserSyncServiceObserver, |
25 public SigninErrorController::Observer { | 25 public SigninErrorController::Observer { |
26 public: | 26 public: |
27 typedef base::CallbackList<void(const std::string&, const std::string&)> | 27 typedef base::CallbackList<void(const std::string&, const std::string&)> |
28 CallbackList; | 28 CallbackList; |
29 | 29 |
30 SupervisedUserImportHandler(); | 30 SupervisedUserImportHandler(); |
31 virtual ~SupervisedUserImportHandler(); | 31 ~SupervisedUserImportHandler() override; |
32 | 32 |
33 // OptionsPageUIHandler implementation. | 33 // OptionsPageUIHandler implementation. |
34 virtual void GetLocalizedValues( | 34 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
35 base::DictionaryValue* localized_strings) override; | 35 void InitializeHandler() override; |
36 virtual void InitializeHandler() override; | |
37 | 36 |
38 // WebUIMessageHandler implementation. | 37 // WebUIMessageHandler implementation. |
39 virtual void RegisterMessages() override; | 38 void RegisterMessages() override; |
40 | 39 |
41 // SupervisedUserSyncServiceObserver implementation. | 40 // SupervisedUserSyncServiceObserver implementation. |
42 virtual void OnSupervisedUserAcknowledged( | 41 void OnSupervisedUserAcknowledged( |
43 const std::string& supervised_user_id) override {} | 42 const std::string& supervised_user_id) override {} |
44 virtual void OnSupervisedUsersSyncingStopped() override {} | 43 void OnSupervisedUsersSyncingStopped() override {} |
45 virtual void OnSupervisedUsersChanged() override; | 44 void OnSupervisedUsersChanged() override; |
46 | 45 |
47 // SigninErrorController::Observer implementation. | 46 // SigninErrorController::Observer implementation. |
48 virtual void OnErrorChanged() override; | 47 void OnErrorChanged() override; |
49 | 48 |
50 private: | 49 private: |
51 // Clears the cached list of supervised users and fetches the new list of | 50 // Clears the cached list of supervised users and fetches the new list of |
52 // supervised users. | 51 // supervised users. |
53 void FetchSupervisedUsers(); | 52 void FetchSupervisedUsers(); |
54 | 53 |
55 // Callback for the "requestSupervisedUserImportUpdate" message. | 54 // Callback for the "requestSupervisedUserImportUpdate" message. |
56 // Checks the sign-in status of the custodian and accordingly | 55 // Checks the sign-in status of the custodian and accordingly |
57 // sends an update to the WebUI. The update can be to show/hide | 56 // sends an update to the WebUI. The update can be to show/hide |
58 // an error bubble and update/clear the supervised user list. | 57 // an error bubble and update/clear the supervised user list. |
(...skipping 28 matching lines...) Expand all Loading... |
87 ScopedObserver<SigninErrorController, SupervisedUserImportHandler> observer_; | 86 ScopedObserver<SigninErrorController, SupervisedUserImportHandler> observer_; |
88 | 87 |
89 base::WeakPtrFactory<SupervisedUserImportHandler> weak_ptr_factory_; | 88 base::WeakPtrFactory<SupervisedUserImportHandler> weak_ptr_factory_; |
90 | 89 |
91 DISALLOW_COPY_AND_ASSIGN(SupervisedUserImportHandler); | 90 DISALLOW_COPY_AND_ASSIGN(SupervisedUserImportHandler); |
92 }; | 91 }; |
93 | 92 |
94 } // namespace options | 93 } // namespace options |
95 | 94 |
96 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_IMPORT_HANDLER_H_ | 95 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_IMPORT_HANDLER_H_ |
OLD | NEW |