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

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: Fixed/reenabled browser tests (hopefully) 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..627bfd70c6a32b5a33a5a1c0e14b6da53572f565 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
@@ -38,7 +38,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 +52,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 +65,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();
+
+ // 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_;
+
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 +117,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 not implemented
bcwhite 2013/04/16 15:22:00 Not implemented? Meaning it can return NULL?
noms (inactive) 2013/04/16 17:15:37 Oops. Just meant it's not initially displayed. Hav
// 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