| 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 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // Displays the one-click signin confirmation bubble (before syncing | 22 // Displays the one-click signin confirmation bubble (before syncing |
| 23 // has started). | 23 // has started). |
| 24 class OneClickSigninBubbleGtk : public BubbleDelegateGtk { | 24 class OneClickSigninBubbleGtk : public BubbleDelegateGtk { |
| 25 public: | 25 public: |
| 26 // Deletes self on close. The given callback will be called if the | 26 // Deletes self on close. The given callback will be called if the |
| 27 // user decides to start sync. | 27 // user decides to start sync. |
| 28 OneClickSigninBubbleGtk( | 28 OneClickSigninBubbleGtk( |
| 29 BrowserWindowGtk* browser_window_gtk, | 29 BrowserWindowGtk* browser_window_gtk, |
| 30 BrowserWindow::OneClickSigninBubbleType type, | 30 BrowserWindow::OneClickSigninBubbleType type, |
| 31 const string16& email, | 31 const string16& email, |
| 32 const string16& error_message, |
| 32 const BrowserWindow::StartSyncCallback& start_sync_callback); | 33 const BrowserWindow::StartSyncCallback& start_sync_callback); |
| 33 | 34 |
| 34 // BubbleDelegateGtk implementation. | 35 // BubbleDelegateGtk implementation. |
| 35 virtual void BubbleClosing( | 36 virtual void BubbleClosing( |
| 36 BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; | 37 BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; |
| 37 | 38 |
| 38 private: | 39 private: |
| 39 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, ShowAndOK); | 40 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, DialogShowAndOK); |
| 40 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, ShowAndUndo); | 41 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, DialogShowAndUndo); |
| 41 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, ShowAndClickAdvanced); | 42 FRIEND_TEST_ALL_PREFIXES( |
| 42 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, ShowAndClose); | 43 OneClickSigninBubbleGtkTest, DialogShowAndClickAdvanced); |
| 44 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, DialogShowAndClose); |
| 45 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, BubbleShowAndOK); |
| 46 FRIEND_TEST_ALL_PREFIXES( |
| 47 OneClickSigninBubbleGtkTest, BubbleShowAndClickAdvanced); |
| 48 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, BubbleShowAndClose); |
| 43 | 49 |
| 44 virtual ~OneClickSigninBubbleGtk(); | 50 virtual ~OneClickSigninBubbleGtk(); |
| 45 | 51 |
| 46 void InitializeWidgets(BrowserWindowGtk* window); | 52 void InitializeWidgets(BrowserWindowGtk* window); |
| 47 GtkWidget* LayoutWidgets(); | 53 GtkWidget* LayoutWidgets(); |
| 48 void ShowWidget(BrowserWindowGtk* browser_window_gtk, | 54 void ShowWidget(BrowserWindowGtk* browser_window_gtk, |
| 49 GtkWidget* content_widget); | 55 GtkWidget* content_widget); |
| 50 | 56 |
| 51 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickAdvancedLink); | 57 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickAdvancedLink); |
| 52 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickOK); | 58 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickOK); |
| 53 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickUndo); | 59 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickUndo); |
| 54 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickLearnMoreLink); | 60 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickLearnMoreLink); |
| 55 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickCloseButton); | 61 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickCloseButton); |
| 56 | 62 |
| 57 BubbleGtk* bubble_; | 63 BubbleGtk* bubble_; |
| 58 | 64 |
| 65 const string16 email_; |
| 66 |
| 67 const string16 error_message_; |
| 68 |
| 59 // This callback is nulled once its called, so that it is called only once. | 69 // This callback is nulled once its called, so that it is called only once. |
| 60 // It will be called when the bubble is closed if it has not been called | 70 // It will be called when the bubble is closed if it has not been called |
| 61 // and nulled earlier. | 71 // and nulled earlier. |
| 62 BrowserWindow::StartSyncCallback start_sync_callback_; | 72 BrowserWindow::StartSyncCallback start_sync_callback_; |
| 63 | 73 |
| 64 bool is_modal_; | 74 bool is_sync_dialog_; |
| 65 const string16 email_; | |
| 66 | 75 |
| 67 GtkWidget* message_label_; | 76 GtkWidget* message_label_; |
| 68 GtkWidget* advanced_link_; | 77 GtkWidget* advanced_link_; |
| 69 GtkWidget* ok_button_; | 78 GtkWidget* ok_button_; |
| 70 GtkWidget* undo_button_; | 79 GtkWidget* undo_button_; |
| 71 | 80 |
| 72 // These widgets are only used in the modal dialog, and not in the bubble. | 81 // These widgets are only used in the modal dialog, and not in the bubble. |
| 73 GtkWidget* learn_more_; | 82 GtkWidget* learn_more_; |
| 74 GtkWidget* header_label_; | 83 GtkWidget* header_label_; |
| 75 scoped_ptr<CustomDrawButton> close_button_; | 84 scoped_ptr<CustomDrawButton> close_button_; |
| 76 | 85 |
| 77 bool clicked_learn_more_; | 86 bool clicked_learn_more_; |
| 78 | 87 |
| 79 DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleGtk); | 88 DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleGtk); |
| 80 }; | 89 }; |
| 81 | 90 |
| 82 #endif // CHROME_BROWSER_UI_GTK_ONE_CLICK_SIGNIN_BUBBLE_GTK_H_ | 91 #endif // CHROME_BROWSER_UI_GTK_ONE_CLICK_SIGNIN_BUBBLE_GTK_H_ |
| OLD | NEW |