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

Unified Diff: chrome/browser/ui/views/sync/one_click_signin_bubble_view.h

Issue 13979003: Win: Display a native bubble (instead of the JS one) after the web signin flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Lint + review fixes Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/sync/one_click_signin_bubble_view.h
diff --git a/chrome/browser/ui/views/sync/one_click_signin_bubble_view.h b/chrome/browser/ui/views/sync/one_click_signin_bubble_view.h
index e8a2c9f679394ab49773e3748753dfe61e32d612..b030b56fbc7ac350f55a1da8a8feb1f1f40c97d2 100644
--- a/chrome/browser/ui/views/sync/one_click_signin_bubble_view.h
+++ b/chrome/browser/ui/views/sync/one_click_signin_bubble_view.h
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_VIEWS_SYNC_ONE_CLICK_SIGNIN_BUBBLE_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_SYNC_ONE_CLICK_SIGNIN_BUBBLE_VIEW_H_
+#include <string>
+
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
@@ -38,7 +40,8 @@ class OneClickSigninBubbleView : public views::BubbleDelegateView,
static void ShowBubble(BrowserWindow::OneClickSigninBubbleType type,
const string16& email,
ToolbarView* toolbar_view,
- const BrowserWindow::StartSyncCallback& start_sync);
+ const BrowserWindow::StartSyncCallback& start_sync,
+ const std::string& error_message);
static bool IsShowing();
@@ -51,8 +54,9 @@ class OneClickSigninBubbleView : public views::BubbleDelegateView,
protected:
// Creates a OneClickSigninBubbleView.
OneClickSigninBubbleView(
+ content::WebContents* web_content,
views::View* anchor_view,
- const BrowserWindow::StartSyncCallback& start_sync_callback);
+ const std::string& error_message);
virtual ~OneClickSigninBubbleView();
@@ -63,13 +67,51 @@ class OneClickSigninBubbleView : public views::BubbleDelegateView,
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
+ // views::View method:
+ virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
+
+ // Creates learn more link to be used at the bottom of the bubble.
+ // Derived classes can reimplement. The caller of this function owns the
+ // returned link.
+ virtual views::Link* GetLearnMoreLink();
+
+ // Creates advanced link to be used at the bottom of the bubble.
+ // Derived classes can reimplement. The caller of this function owns the
+ // returned link.
+ virtual views::Link* GetAdvancedLink();
Roger Tawa OOO till Jul 10th 2013/04/17 17:53:25 The GetXXXLink() methods should probably moved bel
noms (inactive) 2013/04/17 20:32:37 Moved all of them to private as I killed the silly
+
+ // views::WidgetDelegate method:
+ virtual void WindowClosing() OVERRIDE;
+
+ // Link to sync setup advanced page.
+ views::Link* advanced_link_;
+
+ // Link to the Learn More details page
+ views::Link* learn_more_link_;
+
+ // Controls at bottom of bubble.
+ views::LabelButton* ok_button_;
+ views::LabelButton* undo_button_;
+
+ content::WebContents* web_content_;
Roger Tawa OOO till Jul 10th 2013/04/17 17:53:25 Member variables should always be private. Might
noms (inactive) 2013/04/17 20:32:37 Done.
+
private:
friend class OneClickSigninBubbleViewBrowserTest;
- FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleViewBrowserTest, OkButton);
- FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleViewBrowserTest, UndoButton);
- FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleViewBrowserTest, AdvancedLink);
-
+ FRIEND_TEST_ALL_PREFIXES(
+ OneClickSigninBubbleViewBrowserTest, BubbleOkButton);
+ FRIEND_TEST_ALL_PREFIXES(
+ OneClickSigninBubbleViewBrowserTest, DialogOkButton);
+ FRIEND_TEST_ALL_PREFIXES(
+ OneClickSigninBubbleViewBrowserTest, DialogUndoButton);
+ FRIEND_TEST_ALL_PREFIXES(
+ OneClickSigninBubbleViewBrowserTest, BubbleAdvancedLink);
+ FRIEND_TEST_ALL_PREFIXES(
+ OneClickSigninBubbleViewBrowserTest, DialogAdvancedLink);
+ FRIEND_TEST_ALL_PREFIXES(
+ OneClickSigninBubbleViewBrowserTest, BubbleLearnMoreLink);
+ FRIEND_TEST_ALL_PREFIXES(
+ OneClickSigninBubbleViewBrowserTest, DialogLearnMoreLink);
// views::BubbleDelegateView methods:
virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
virtual void Init() OVERRIDE;
@@ -77,42 +119,24 @@ class OneClickSigninBubbleView : public views::BubbleDelegateView,
// Method to build the main part of the bubble. Derived classes should
// reimplement this function.
virtual void InitContent(views::GridLayout* layout);
+ virtual void InitButtons(views::GridLayout* layout);
- // Creates OK and Undo buttons to be used at the bottom of the bubble.
+ // Creates OK/Undo button to be used at the bottom of the bubble.
+ // By default, the Undo button is initialized, but not displayed
// Derived classes can reimplement to have buttons with different labels,
// colours, or sizes. The caller of this function owns the returned buttons.
virtual void GetButtons(views::LabelButton** ok_button,
views::LabelButton** undo_button);
- // Creates advanced link to be used at the bottom of the bubble.
- // Derived classes can reimplement. The caller of this function owns the
- // returned link.
- virtual views::Link* GetAdvancedLink();
-
- // views::WidgetDelegate method:
- virtual void WindowClosing() OVERRIDE;
-
- // views::View method:
- virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
-
// The bubble, if we're showing one.
static OneClickSigninBubbleView* bubble_view_;
- // Link to sync setup advanced page.
- views::Link* advanced_link_;
-
- // Controls at bottom of bubble.
- views::LabelButton* ok_button_;
- views::LabelButton* undo_button_;
-
- // This callback is nulled once its called, so that it is called only once.
- // It will be called when the bubble is closed if it has not been called
- // and nulled earlier.
- BrowserWindow::StartSyncCallback start_sync_callback_;
-
// A message loop used only with unit tests.
base::MessageLoop* message_loop_for_testing_;
+ // Alternate error message to be displayed
+ std::string error_message_;
+
DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleView);
};

Powered by Google App Engine
This is Rietveld 408576698