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

Side by Side Diff: chrome/browser/ui/gtk/one_click_signin_bubble_gtk.h

Issue 10332185: Update behavior of one-click infobar to remove modal dialog, add "undo". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 8 years, 7 months 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
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 "base/gtest_prod_util.h"
13 #include "chrome/browser/ui/base_window.h"
14 #include "chrome/browser/ui/browser_window.h"
12 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" 15 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
13 16
14 typedef struct _GtkWidget GtkWidget; 17 typedef struct _GtkWidget GtkWidget;
15 typedef struct _GtkWindow GtkWindow; 18 typedef struct _GtkWindow GtkWindow;
16 19
17 class BrowserWindowGtk; 20 class BrowserWindowGtk;
18 21
19 // Displays the one-click signin confirmation bubble (after syncing 22 // Displays the one-click signin confirmation bubble (before syncing
20 // has started). 23 // has started).
21 class OneClickSigninBubbleGtk : public BubbleDelegateGtk { 24 class OneClickSigninBubbleGtk : public BubbleDelegateGtk {
22 public: 25 public:
23 // Deletes self on close. The given callbacks will be called if the 26 // Deletes self on close. The given callback will be called if the
24 // user clicks the corresponding link. 27 // user decides to start sync.
25 OneClickSigninBubbleGtk(BrowserWindowGtk* browser_window_gtk, 28 OneClickSigninBubbleGtk(
26 const base::Closure& learn_more_callback, 29 BrowserWindowGtk* browser_window_gtk,
27 const base::Closure& advanced_callback); 30 const BrowserWindow::StartSyncCallback& start_sync_callback);
28 31
29 // BubbleDelegateGtk implementation. 32 // BubbleDelegateGtk implementation.
30 virtual void BubbleClosing( 33 virtual void BubbleClosing(
31 BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; 34 BubbleGtk* bubble, bool closed_by_escape) OVERRIDE;
32 35
33 void ClickOKForTest();
34 void ClickLearnMoreForTest();
35 void ClickAdvancedForTest();
36
37 private: 36 private:
38 virtual ~OneClickSigninBubbleGtk(); 37 virtual ~OneClickSigninBubbleGtk();
39 38
40 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickLearnMoreLink);
41 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickAdvancedLink); 39 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickAdvancedLink);
42 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickOK); 40 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickOK);
41 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickUndo);
43 42
44 BubbleGtk* bubble_; 43 BubbleGtk* bubble_;
45 const base::Closure learn_more_callback_; 44
46 const base::Closure advanced_callback_; 45 // This callback is nulled once its called, so that it is called only once.
46 // It will be called when the bubble is closed if it has not been called
47 // and nulled earlier.
48 BrowserWindow::StartSyncCallback start_sync_callback_;
49
50 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, ShowAndOK);
Peter Kasting 2012/05/25 21:09:33 Nit: These go atop private section
Roger Tawa OOO till Jul 10th 2012/05/26 01:56:02 Done.
51 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, ShowAndUndo);
52 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, ShowAndClickAdvanced);
53 FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleGtkTest, ShowAndClose);
47 54
48 DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleGtk); 55 DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleGtk);
49 }; 56 };
50 57
51 #endif // CHROME_BROWSER_UI_GTK_ONE_CLICK_SIGNIN_BUBBLE_GTK_H_ 58 #endif // CHROME_BROWSER_UI_GTK_ONE_CLICK_SIGNIN_BUBBLE_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698