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

Side by Side Diff: chrome/browser/ui/webui/sync_promo_handler2.h

Issue 8895023: Options2: Pull the trigger. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DIAF. Created 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_HANDLER_H_
7 #pragma once
8
9 #include "chrome/browser/ui/webui/sync_setup_handler2.h"
10
11 class PrefService;
12
13 // The handler for JavaScript messages related to the "sync promo" page.
14 class SyncPromoHandler2 : public SyncSetupHandler2 {
15 public:
16 explicit SyncPromoHandler2(ProfileManager* profile_manager);
17 virtual ~SyncPromoHandler2();
18
19 // Called to register our preferences before we use them (so there will be a
20 // default if not present yet).
21 static void RegisterUserPrefs(PrefService* prefs);
22
23 // WebUIMessageHandler implementation.
24 virtual WebUIMessageHandler* Attach(WebUI* web_ui) OVERRIDE;
25 virtual void RegisterMessages() OVERRIDE;
26
27 // SyncSetupFlowHandler implementation.
28 virtual void ShowGaiaSuccessAndClose() OVERRIDE;
29 virtual void ShowGaiaSuccessAndSettingUp() OVERRIDE;
30 virtual void ShowConfigure(const base::DictionaryValue& args) OVERRIDE;
31
32 // content::NotificationObserver implementation.
33 virtual void Observe(int type,
34 const content::NotificationSource& source,
35 const content::NotificationDetails& details) OVERRIDE;
36
37 protected:
38 virtual void StepWizardForShowSetupUI() OVERRIDE;
39
40 virtual void ShowSetupUI() OVERRIDE;
41
42 private:
43 // JavaScript callback handler to close the sync promo.
44 void HandleCloseSyncPromo(const base::ListValue* args);
45
46 // JavaScript callback handler to initialize the sync promo.
47 void HandleInitializeSyncPromo(const base::ListValue* args);
48
49 // JavaScript handler to record the duration for which the throbber was
50 // visible during an attempted sign-in flow.
51 void HandleRecordThrobberTime(const base::ListValue* args);
52
53 // JavaScript handler to record the number of times a user attempted to sign
54 // in to chrome while they were on the sync promo page.
55 void HandleRecordSignInAttempts(const base::ListValue* args);
56
57 // JavaScript callback handler to switch the advanced sync settings. |args| is
58 // the list of arguments passed from JS and should be an empty list.
59 void HandleShowAdvancedSettings(const base::ListValue* args);
60
61 // JavaScript callback handler to record user actions on the sync promo.
62 void HandleUserFlowAction(const base::ListValue* args);
63
64 // JavaScript callback handler for when a user clicks skip.
65 void HandleUserSkipped(const base::ListValue* args);
66
67 // Return the number of times the user with the current profile has seen the
68 // sync promo.
69 int GetViewCount() const;
70
71 // Increment the local view count by the specified non-negative integer
72 // amount. Returns the new total view count.
73 int IncrementViewCountBy(unsigned int amount);
74
75 // Record a user's flow through the promo to our histogram in UMA.
76 void RecordUserFlowAction(int action);
77
78 // Load any experiments that run on the promo page.
79 void LoadPromoExperiments();
80
81 // Use this to register for certain notifications (currently when tabs or
82 // windows close).
83 content::NotificationRegistrar registrar_;
84
85 // Weak reference that's initialized and checked in Attach() (after that
86 // guaranteed to be non-NULL).
87 PrefService* prefs_;
88
89 // If the user closes the whole window we'll get a close notification from the
90 // tab as well, so this bool acts as a small mutex to only report the close
91 // method once.
92 bool window_already_closed_;
93
94 DISALLOW_COPY_AND_ASSIGN(SyncPromoHandler2);
95 };
96
97 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options2/web_intents_settings_handler.cc ('k') | chrome/browser/ui/webui/sync_promo_handler2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698