• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_OPTIONS_SYNC_SETUP_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_SYNC_SETUP_HANDLER_H_
7 
8 #include "chrome/browser/sync/sync_setup_flow_handler.h"
9 #include "chrome/browser/ui/webui/options/options_ui.h"
10 
11 class SyncSetupFlow;
12 
13 class SyncSetupHandler : public OptionsPageUIHandler,
14                          public SyncSetupFlowHandler {
15  public:
16   SyncSetupHandler();
17   virtual ~SyncSetupHandler();
18 
19   // OptionsPageUIHandler implementation.
20   virtual void GetLocalizedValues(DictionaryValue* localized_strings);
21   virtual void Initialize();
22   virtual void RegisterMessages();
23 
24   // SyncSetupFlowHandler implementation.
25   virtual void ShowGaiaLogin(const DictionaryValue& args);
26   virtual void ShowGaiaSuccessAndClose();
27   virtual void ShowGaiaSuccessAndSettingUp();
28   virtual void ShowConfigure(const DictionaryValue& args);
29   virtual void ShowPassphraseEntry(const DictionaryValue& args);
30   virtual void ShowFirstPassphrase(const DictionaryValue& args);
31   virtual void ShowSettingUp();
32   virtual void ShowSetupDone(const std::wstring& user);
33   virtual void ShowFirstTimeDone(const std::wstring& user);
34 
SetFlow(SyncSetupFlow * flow)35   virtual void SetFlow(SyncSetupFlow* flow) {
36     flow_ = flow;
37   }
38 
39  private:
40   // Callbacks from the page.
41   void OnDidShowPage(const ListValue* args);
42   void OnDidClosePage(const ListValue* args);
43   void HandleSubmitAuth(const ListValue* args);
44   void HandleConfigure(const ListValue* args);
45   void HandlePassphraseEntry(const ListValue* args);
46   void HandlePassphraseCancel(const ListValue* args);
47   void HandleFirstPassphrase(const ListValue* args);
48   void HandleGoToDashboard(const ListValue* args);
49 
50   // Weak reference.
51   SyncSetupFlow* flow_;
52 
53   DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler);
54 };
55 
56 #endif  // CHROME_BROWSER_UI_WEBUI_OPTIONS_SYNC_SETUP_HANDLER_H_
57