Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1417)

Side by Side Diff: chrome/browser/ui/webui/options/supervised_user_import_handler.h

Issue 1123283011: Use ScopedObserver to observe the SupervisedUserSyncService in SupervisedUserImportHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/supervised_user_import_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <string> 8 #include <string>
9 9
10 #include "base/callback_list.h" 10 #include "base/callback_list.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/scoped_observer.h" 12 #include "base/scoped_observer.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "chrome/browser/profiles/profile_info_cache_observer.h" 14 #include "chrome/browser/profiles/profile_info_cache_observer.h"
15 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_obs erver.h" 15 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_obs erver.h"
16 #include "chrome/browser/ui/webui/options/options_ui.h" 16 #include "chrome/browser/ui/webui/options/options_ui.h"
17 #include "components/signin/core/browser/signin_error_controller.h" 17 #include "components/signin/core/browser/signin_error_controller.h"
18 18
19 namespace base { 19 namespace base {
20 class DictionaryValue; 20 class DictionaryValue;
21 class ListValue; 21 class ListValue;
22 } 22 }
23 23
24 class ProfileInfoCache; 24 class ProfileInfoCache;
25 class SupervisedUserSyncService;
25 26
26 namespace options { 27 namespace options {
27 28
28 // Handler for the 'import existing supervised user' dialog. 29 // Handler for the 'import existing supervised user' dialog.
29 class SupervisedUserImportHandler : public OptionsPageUIHandler, 30 class SupervisedUserImportHandler : public OptionsPageUIHandler,
30 public ProfileInfoCacheObserver, 31 public ProfileInfoCacheObserver,
31 public SupervisedUserSyncServiceObserver, 32 public SupervisedUserSyncServiceObserver,
32 public SigninErrorController::Observer { 33 public SigninErrorController::Observer {
33 public: 34 public:
34 typedef base::CallbackList<void(const std::string&, const std::string&)> 35 typedef base::CallbackList<void(const std::string&, const std::string&)>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // changed, FetchSupervisedUsers() is called. 94 // changed, FetchSupervisedUsers() is called.
94 void OnSharedSettingChanged(const std::string& supervised_user_id, 95 void OnSharedSettingChanged(const std::string& supervised_user_id,
95 const std::string& key); 96 const std::string& key);
96 97
97 scoped_ptr<CallbackList::Subscription> subscription_; 98 scoped_ptr<CallbackList::Subscription> subscription_;
98 99
99 ScopedObserver<ProfileInfoCache, SupervisedUserImportHandler> 100 ScopedObserver<ProfileInfoCache, SupervisedUserImportHandler>
100 profile_observer_; 101 profile_observer_;
101 ScopedObserver<SigninErrorController, SupervisedUserImportHandler> 102 ScopedObserver<SigninErrorController, SupervisedUserImportHandler>
102 signin_error_observer_; 103 signin_error_observer_;
104 ScopedObserver<SupervisedUserSyncService, SupervisedUserImportHandler>
105 supervised_user_sync_service_observer_;
103 106
104 bool removed_profile_is_supervised_; 107 bool removed_profile_is_supervised_;
105 108
106 base::WeakPtrFactory<SupervisedUserImportHandler> weak_ptr_factory_; 109 base::WeakPtrFactory<SupervisedUserImportHandler> weak_ptr_factory_;
107 110
108 DISALLOW_COPY_AND_ASSIGN(SupervisedUserImportHandler); 111 DISALLOW_COPY_AND_ASSIGN(SupervisedUserImportHandler);
109 }; 112 };
110 113
111 } // namespace options 114 } // namespace options
112 115
113 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_IMPORT_HANDLER_H_ 116 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_IMPORT_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/supervised_user_import_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698