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

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: Make GTK ok and undo buttons the same size horizontally 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 "chrome/browser/ui/base_window.h"
13 #include "chrome/browser/ui/browser_window.h"
12 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" 14 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
13 15
14 typedef struct _GtkWidget GtkWidget; 16 typedef struct _GtkWidget GtkWidget;
15 typedef struct _GtkWindow GtkWindow; 17 typedef struct _GtkWindow GtkWindow;
16 18
17 class BrowserWindowGtk; 19 class BrowserWindowGtk;
18 20
19 // Displays the one-click signin confirmation bubble (after syncing 21 // Displays the one-click signin confirmation bubble (before syncing
20 // has started). 22 // has started).
21 class OneClickSigninBubbleGtk : public BubbleDelegateGtk { 23 class OneClickSigninBubbleGtk : public BubbleDelegateGtk {
22 public: 24 public:
23 // Deletes self on close. The given callbacks will be called if the 25 // Deletes self on close. The given callback will be called if the
24 // user clicks the corresponding link. 26 // user decides to start sync.
25 OneClickSigninBubbleGtk(BrowserWindowGtk* browser_window_gtk, 27 OneClickSigninBubbleGtk(
26 const base::Closure& learn_more_callback, 28 BrowserWindowGtk* browser_window_gtk,
27 const base::Closure& advanced_callback); 29 const BrowserWindow::StartSyncCallback& start_sync_callback);
28 30
29 // BubbleDelegateGtk implementation. 31 // BubbleDelegateGtk implementation.
30 virtual void BubbleClosing( 32 virtual void BubbleClosing(
31 BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; 33 BubbleGtk* bubble, bool closed_by_escape) OVERRIDE;
32 34
33 void ClickOKForTest(); 35 void ClickOKForTest();
Peter Kasting 2012/05/24 22:25:18 Nit: The implementations of these are so simple th
Roger Tawa OOO till Jul 10th 2012/05/25 16:04:08 I like it better as is if you don't have huge obje
Peter Kasting 2012/05/25 16:58:06 My problem with XXXForTest() is that it still leak
34 void ClickLearnMoreForTest(); 36 void ClickUndoForTest();
35 void ClickAdvancedForTest(); 37 void ClickAdvancedForTest();
38 void CloseForTest();
36 39
37 private: 40 private:
38 virtual ~OneClickSigninBubbleGtk(); 41 virtual ~OneClickSigninBubbleGtk();
39 42
40 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickLearnMoreLink);
41 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickAdvancedLink); 43 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickAdvancedLink);
42 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickOK); 44 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickOK);
45 CHROMEGTK_CALLBACK_0(OneClickSigninBubbleGtk, void, OnClickUndo);
43 46
44 BubbleGtk* bubble_; 47 BubbleGtk* bubble_;
45 const base::Closure learn_more_callback_; 48
46 const base::Closure advanced_callback_; 49 // This callback is nulled once its called, so that it is called only once.
50 // It will be called when the bubble is closed if it has not been called
51 // and nulled earlier.
52 BrowserWindow::StartSyncCallback start_sync_callback_;
47 53
48 DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleGtk); 54 DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleGtk);
49 }; 55 };
50 56
51 #endif // CHROME_BROWSER_UI_GTK_ONE_CLICK_SIGNIN_BUBBLE_GTK_H_ 57 #endif // CHROME_BROWSER_UI_GTK_ONE_CLICK_SIGNIN_BUBBLE_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698