OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GTK_ONE_CLICK_SIGNIN_BUBBLE_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_ONE_CLICK_SIGNIN_BUBBLE_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_ONE_CLICK_SIGNIN_BUBBLE_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_ONE_CLICK_SIGNIN_BUBBLE_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" | 12 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" |
13 | 13 |
14 typedef struct _GtkWidget GtkWidget; | 14 typedef struct _GtkWidget GtkWidget; |
15 typedef struct _GtkWindow GtkWindow; | 15 typedef struct _GtkWindow GtkWindow; |
16 | 16 |
17 class BrowserWindowGtk; | 17 class BrowserWindowGtk; |
18 | 18 |
19 // Displays the one-click signin confirmation bubble (after syncing | 19 // Displays the one-click signin confirmation bubble (before syncing |
20 // has started). | 20 // has started). |
21 class OneClickSigninBubbleGtk : public BubbleDelegateGtk { | 21 class OneClickSigninBubbleGtk : public BubbleDelegateGtk { |
22 public: | 22 public: |
23 // Deletes self on close. The given callbacks will be called if the | 23 // Deletes self on close. The given callback will be called if the |
24 // user clicks the corresponding link. | 24 // user decides to start sync. |
25 OneClickSigninBubbleGtk(BrowserWindowGtk* browser_window_gtk, | 25 OneClickSigninBubbleGtk( |
26 const base::Closure& learn_more_callback, | 26 BrowserWindowGtk* browser_window_gtk, |
27 const base::Closure& advanced_callback); | 27 const base::Callback<void(bool)>& start_sync_callback); |
28 | 28 |
29 // BubbleDelegateGtk implementation. | 29 // BubbleDelegateGtk implementation. |
30 virtual void BubbleClosing( | 30 virtual void BubbleClosing( |
31 BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; | 31 BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; |
32 | 32 |
33 void ClickOKForTest(); | 33 void ClickOKForTest(); |
34 void ClickLearnMoreForTest(); | 34 void ClickUndoForTest(); |
35 void ClickAdvancedForTest(); | 35 void ClickAdvancedForTest(); |
36 void CloseForTest(); | |
36 | 37 |
37 private: | 38 private: |
38 virtual ~OneClickSigninBubbleGtk(); | 39 virtual ~OneClickSigninBubbleGtk(); |
39 | 40 |
40 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickLearnMoreLink); | |
41 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickAdvancedLink); | 41 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickAdvancedLink); |
42 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickOK); | 42 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickOK); |
43 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickUndo); | |
43 | 44 |
44 BubbleGtk* bubble_; | 45 BubbleGtk* bubble_; |
45 const base::Closure learn_more_callback_; | 46 const base::Callback<void(bool)> start_sync_callback_; |
46 const base::Closure advanced_callback_; | 47 bool call_sync_callback_on_close_; |
akalin
2012/05/17 00:39:24
seems cleaner to me to remove the bool, make the c
Roger Tawa OOO till Jul 10th
2012/05/17 21:17:37
Done.
| |
47 | 48 |
48 DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleGtk); | 49 DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleGtk); |
49 }; | 50 }; |
50 | 51 |
51 #endif // CHROME_BROWSER_UI_GTK_ONE_CLICK_SIGNIN_BUBBLE_GTK_H_ | 52 #endif // CHROME_BROWSER_UI_GTK_ONE_CLICK_SIGNIN_BUBBLE_GTK_H_ |
OLD | NEW |