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

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

Issue 1473543002: Implement newly designed sign-in related histograms for desktop platorms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: document signin.signinreason histogram Created 5 years 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_SYNC_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SYNC_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SYNC_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SYNC_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/timer/timer.h" 14 #include "base/timer/timer.h"
14 #include "chrome/browser/sync/sync_startup_tracker.h" 15 #include "chrome/browser/sync/sync_startup_tracker.h"
15 #include "chrome/browser/ui/webui/signin/login_ui_service.h" 16 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
16 #include "components/signin/core/browser/signin_manager_base.h" 17 #include "components/signin/core/browser/signin_manager_base.h"
17 #include "components/sync_driver/sync_service_observer.h" 18 #include "components/sync_driver/sync_service_observer.h"
18 #include "content/public/browser/web_ui_message_handler.h" 19 #include "content/public/browser/web_ui_message_handler.h"
19 20
20 class LoginUIService; 21 class LoginUIService;
21 class ProfileSyncService; 22 class ProfileSyncService;
22 class SigninManagerBase; 23 class SigninManagerBase;
23 24
24 namespace content { 25 namespace content {
25 class WebContents; 26 class WebContents;
26 class WebUI; 27 class WebUI;
27 } 28 }
28 29
30 namespace signin_metrics {
31 enum class AccessPoint : int;
32 }
33
29 namespace settings { 34 namespace settings {
30 35
31 class SyncHandler : public content::WebUIMessageHandler, 36 class SyncHandler : public content::WebUIMessageHandler,
32 public SigninManagerBase::Observer, 37 public SigninManagerBase::Observer,
33 public SyncStartupTracker::Observer, 38 public SyncStartupTracker::Observer,
34 public LoginUIService::LoginUI, 39 public LoginUIService::LoginUI,
35 public sync_driver::SyncServiceObserver { 40 public sync_driver::SyncServiceObserver {
36 public: 41 public:
37 explicit SyncHandler(Profile* profile); 42 explicit SyncHandler(Profile* profile);
38 ~SyncHandler() override; 43 ~SyncHandler() override;
(...skipping 13 matching lines...) Expand all
52 void GoogleSigninSucceeded(const std::string& account_id, 57 void GoogleSigninSucceeded(const std::string& account_id,
53 const std::string& username, 58 const std::string& username,
54 const std::string& password) override; 59 const std::string& password) override;
55 void GoogleSignedOut(const std::string& account_id, 60 void GoogleSignedOut(const std::string& account_id,
56 const std::string& username) override; 61 const std::string& username) override;
57 62
58 // sync_driver::SyncServiceObserver implementation. 63 // sync_driver::SyncServiceObserver implementation.
59 void OnStateChanged() override; 64 void OnStateChanged() override;
60 65
61 // Initializes the sync setup flow and shows the setup UI. 66 // Initializes the sync setup flow and shows the setup UI.
62 void OpenSyncSetup(); 67 void OpenSyncSetup(const base::ListValue* args);
63 68
64 // Shows advanced configuration dialog without going through sign in dialog. 69 // Shows advanced configuration dialog without going through sign in dialog.
65 // Kicks the sync backend if necessary with showing spinner dialog until it 70 // Kicks the sync backend if necessary with showing spinner dialog until it
66 // gets ready. 71 // gets ready.
67 void OpenConfigureSync(); 72 void OpenConfigureSync();
68 73
69 // Terminates the sync setup flow. 74 // Terminates the sync setup flow.
70 void CloseSyncSetup(); 75 void CloseSyncSetup();
71 76
72 // Returns a newly created dictionary with a number of properties that 77 // Returns a newly created dictionary with a number of properties that
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void HandlePassphraseCancel(const base::ListValue* args); 124 void HandlePassphraseCancel(const base::ListValue* args);
120 void HandleShowSetupUI(const base::ListValue* args); 125 void HandleShowSetupUI(const base::ListValue* args);
121 void HandleDoSignOutOnAuthError(const base::ListValue* args); 126 void HandleDoSignOutOnAuthError(const base::ListValue* args);
122 void HandleStartSignin(const base::ListValue* args); 127 void HandleStartSignin(const base::ListValue* args);
123 void HandleStopSyncing(const base::ListValue* args); 128 void HandleStopSyncing(const base::ListValue* args);
124 void HandleCloseTimeout(const base::ListValue* args); 129 void HandleCloseTimeout(const base::ListValue* args);
125 void HandleGetSyncStatus(const base::ListValue* args); 130 void HandleGetSyncStatus(const base::ListValue* args);
126 131
127 #if !defined(OS_CHROMEOS) 132 #if !defined(OS_CHROMEOS)
128 // Displays the GAIA login form. 133 // Displays the GAIA login form.
129 void DisplayGaiaLogin(); 134 void DisplayGaiaLogin(signin_metrics::AccessPoint access_point);
130 135
131 // When web-flow is enabled, displays the Gaia login form in a new tab. 136 // When web-flow is enabled, displays the Gaia login form in a new tab.
132 // This function is virtual so that tests can override. 137 // This function is virtual so that tests can override.
133 virtual void DisplayGaiaLoginInNewTabOrWindow(); 138 virtual void DisplayGaiaLoginInNewTabOrWindow(
139 signin_metrics::AccessPoint access_point);
134 #endif 140 #endif
135 141
136 // A utility function to call before actually showing setup dialog. Makes sure 142 // A utility function to call before actually showing setup dialog. Makes sure
137 // that a new dialog can be shown and sets flag that setup is in progress. 143 // that a new dialog can be shown and sets flag that setup is in progress.
138 bool PrepareSyncSetup(); 144 bool PrepareSyncSetup();
139 145
140 // Displays spinner-only UI indicating that something is going on in the 146 // Displays spinner-only UI indicating that something is going on in the
141 // background. 147 // background.
142 // TODO(kochi): better to show some message that the user can understand what 148 // TODO(kochi): better to show some message that the user can understand what
143 // is running in the background. 149 // is running in the background.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 191
186 // Manages observer lifetime. 192 // Manages observer lifetime.
187 ScopedObserver<ProfileSyncService, SyncHandler> sync_service_observer_; 193 ScopedObserver<ProfileSyncService, SyncHandler> sync_service_observer_;
188 194
189 DISALLOW_COPY_AND_ASSIGN(SyncHandler); 195 DISALLOW_COPY_AND_ASSIGN(SyncHandler);
190 }; 196 };
191 197
192 } // namespace settings 198 } // namespace settings
193 199
194 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SYNC_HANDLER_H_ 200 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SYNC_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698