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

Side by Side Diff: chrome/browser/ui/webui/settings/people_handler.h

Issue 1568963003: Revert of Settings People Revamp: Implement Chrome Profile name/icon selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
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_PEOPLE_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/prefs/pref_change_registrar.h" 11 #include "base/prefs/pref_change_registrar.h"
12 #include "base/scoped_observer.h" 12 #include "base/scoped_observer.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "base/timer/timer.h" 14 #include "base/timer/timer.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 #include "chrome/browser/profiles/profile_info_cache_observer.h"
17 #include "chrome/browser/sync/sync_startup_tracker.h" 16 #include "chrome/browser/sync/sync_startup_tracker.h"
18 #include "chrome/browser/ui/webui/signin/login_ui_service.h" 17 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
19 #include "components/signin/core/browser/signin_manager_base.h" 18 #include "components/signin/core/browser/signin_manager_base.h"
20 #include "components/sync_driver/sync_service_observer.h" 19 #include "components/sync_driver/sync_service_observer.h"
21 #include "content/public/browser/web_ui_message_handler.h" 20 #include "content/public/browser/web_ui_message_handler.h"
22 21
23 class LoginUIService; 22 class LoginUIService;
24 class ProfileSyncService; 23 class ProfileSyncService;
25 class SigninManagerBase; 24 class SigninManagerBase;
26 25
27 namespace content { 26 namespace content {
28 class WebContents; 27 class WebContents;
29 class WebUI; 28 class WebUI;
30 } 29 }
31 30
32 namespace signin_metrics { 31 namespace signin_metrics {
33 enum class AccessPoint; 32 enum class AccessPoint;
34 } 33 }
35 34
36 namespace settings { 35 namespace settings {
37 36
38 class PeopleHandler : public content::WebUIMessageHandler, 37 class PeopleHandler : public content::WebUIMessageHandler,
39 public SigninManagerBase::Observer, 38 public SigninManagerBase::Observer,
40 public SyncStartupTracker::Observer, 39 public SyncStartupTracker::Observer,
41 public LoginUIService::LoginUI, 40 public LoginUIService::LoginUI,
42 public sync_driver::SyncServiceObserver, 41 public sync_driver::SyncServiceObserver {
43 public ProfileInfoCacheObserver {
44 public: 42 public:
45 explicit PeopleHandler(Profile* profile); 43 explicit PeopleHandler(Profile* profile);
46 ~PeopleHandler() override; 44 ~PeopleHandler() override;
47 45
48 // content::WebUIMessageHandler implementation. 46 // content::WebUIMessageHandler implementation.
49 void RegisterMessages() override; 47 void RegisterMessages() override;
50 48
51 // SyncStartupTracker::Observer implementation. 49 // SyncStartupTracker::Observer implementation.
52 void SyncStartupCompleted() override; 50 void SyncStartupCompleted() override;
53 void SyncStartupFailed() override; 51 void SyncStartupFailed() override;
54 52
55 // LoginUIService::LoginUI implementation. 53 // LoginUIService::LoginUI implementation.
56 void FocusUI() override; 54 void FocusUI() override;
57 void CloseUI() override; 55 void CloseUI() override;
58 56
59 // SigninManagerBase::Observer implementation. 57 // SigninManagerBase::Observer implementation.
60 void GoogleSigninSucceeded(const std::string& account_id, 58 void GoogleSigninSucceeded(const std::string& account_id,
61 const std::string& username, 59 const std::string& username,
62 const std::string& password) override; 60 const std::string& password) override;
63 void GoogleSignedOut(const std::string& account_id, 61 void GoogleSignedOut(const std::string& account_id,
64 const std::string& username) override; 62 const std::string& username) override;
65 63
66 // sync_driver::SyncServiceObserver implementation. 64 // sync_driver::SyncServiceObserver implementation.
67 void OnStateChanged() override; 65 void OnStateChanged() override;
68 66
69 // ProfileInfoCacheObserver implementation.
70 void OnProfileNameChanged(const base::FilePath& profile_path,
71 const base::string16& old_profile_name) override;
72 void OnProfileAvatarChanged(const base::FilePath& profile_path) override;
73
74 // Initializes the sync setup flow and shows the setup UI. 67 // Initializes the sync setup flow and shows the setup UI.
75 void OpenSyncSetup(const base::ListValue* args); 68 void OpenSyncSetup(const base::ListValue* args);
76 69
77 // Shows advanced configuration dialog without going through sign in dialog. 70 // Shows advanced configuration dialog without going through sign in dialog.
78 // Kicks the sync backend if necessary with showing spinner dialog until it 71 // Kicks the sync backend if necessary with showing spinner dialog until it
79 // gets ready. 72 // gets ready.
80 void OpenConfigureSync(); 73 void OpenConfigureSync();
81 74
82 // Terminates the sync setup flow. 75 // Terminates the sync setup flow.
83 void CloseSyncSetup(); 76 void CloseSyncSetup();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 111
119 // Helper routine that gets the ProfileSyncService associated with the parent 112 // Helper routine that gets the ProfileSyncService associated with the parent
120 // profile. 113 // profile.
121 ProfileSyncService* GetSyncService() const; 114 ProfileSyncService* GetSyncService() const;
122 115
123 // Returns the LoginUIService for the parent profile. 116 // Returns the LoginUIService for the parent profile.
124 LoginUIService* GetLoginUIService() const; 117 LoginUIService* GetLoginUIService() const;
125 118
126 private: 119 private:
127 // Callbacks from the page. 120 // Callbacks from the page.
128 void HandleGetProfileInfo(const base::ListValue* args);
129 void OnDidClosePage(const base::ListValue* args); 121 void OnDidClosePage(const base::ListValue* args);
130 void HandleConfigure(const base::ListValue* args); 122 void HandleConfigure(const base::ListValue* args);
131 void HandlePassphraseEntry(const base::ListValue* args); 123 void HandlePassphraseEntry(const base::ListValue* args);
132 void HandlePassphraseCancel(const base::ListValue* args); 124 void HandlePassphraseCancel(const base::ListValue* args);
133 void HandleShowSetupUI(const base::ListValue* args); 125 void HandleShowSetupUI(const base::ListValue* args);
134 void HandleDoSignOutOnAuthError(const base::ListValue* args); 126 void HandleDoSignOutOnAuthError(const base::ListValue* args);
135 void HandleStartSignin(const base::ListValue* args); 127 void HandleStartSignin(const base::ListValue* args);
136 void HandleStopSyncing(const base::ListValue* args); 128 void HandleStopSyncing(const base::ListValue* args);
137 void HandleCloseTimeout(const base::ListValue* args); 129 void HandleCloseTimeout(const base::ListValue* args);
138 void HandleGetSyncStatus(const base::ListValue* args); 130 void HandleGetSyncStatus(const base::ListValue* args);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 192
201 // Manages observer lifetime. 193 // Manages observer lifetime.
202 ScopedObserver<ProfileSyncService, PeopleHandler> sync_service_observer_; 194 ScopedObserver<ProfileSyncService, PeopleHandler> sync_service_observer_;
203 195
204 DISALLOW_COPY_AND_ASSIGN(PeopleHandler); 196 DISALLOW_COPY_AND_ASSIGN(PeopleHandler);
205 }; 197 };
206 198
207 } // namespace settings 199 } // namespace settings
208 200
209 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ 201 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_ui.cc ('k') | chrome/browser/ui/webui/settings/people_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698