summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/sync_setup_wizard_gtk.h
blob: 6a5dbc7226b02dfebf3759d0ca74ab1a5364bda3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_GTK_SYNC_SETUP_WIZARD_GTK_H_
#define CHROME_BROWSER_GTK_SYNC_SETUP_WIZARD_GTK_H_

#include <gtk/gtk.h>

#include "base/basictypes.h"
#include "base/string16.h"
#include "googleurl/src/gurl.h"

typedef struct _GtkWidget GtkWidget;
typedef struct _GtkWindow GtkWindow;

class ProfileSyncService;

class SyncSetupWizard;

// This class is used as a temporary solution to allow login to bookmark sync on
// Linux.  It will be replaced with the HtmlDialog based solution when
// window->ShowHtmlDialog() is implemented on Linux.
// See: http://code.google.com/p/chromium/issues/detail?id=25260

class SyncSetupWizardGtk {
 public:
  // Displays the dialog box to setup sync.
  static void Show(ProfileSyncService* service,
                   SyncSetupWizard *wizard);

 private:
  SyncSetupWizardGtk(GtkWindow* parent, ProfileSyncService* service,
                     SyncSetupWizard *wizard);
  ~SyncSetupWizardGtk() { }

  // Handler to respond to Ok and Cancel responses from the dialog.
  static void HandleOnResponseDialog(GtkWidget* widget,
      int response, SyncSetupWizardGtk* setup_wizard) {
    setup_wizard->OnDialogResponse(widget, response);
  }

  void OnDialogResponse(GtkWidget* widget, int response);

  // UI elements.
  GtkWidget* username_textbox_;
  GtkWidget* password_textbox_;

  // We need this to write the sentinel "setup completed" pref.
  ProfileSyncService* service_;
  SyncSetupWizard* wizard_;

  DISALLOW_COPY_AND_ASSIGN(SyncSetupWizardGtk);
};

#endif  // CHROME_BROWSER_GTK_SYNC_SETUP_WIZARD_GTK_H_