| 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 e7109cdfc9e460b4b6e04548b3731c964c42d221..6efb1eb36ad7e8eb9662adc61ae62e2db1e03d70 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
|
| @@ -37,6 +37,7 @@ class OneClickSigninBubbleView : public views::BubbleDelegateView,
|
| // to start sync.
|
| static void ShowBubble(BrowserWindow::OneClickSigninBubbleType type,
|
| const string16& email,
|
| + const string16& error_message,
|
| ToolbarView* toolbar_view,
|
| const BrowserWindow::StartSyncCallback& start_sync);
|
|
|
| @@ -51,11 +52,37 @@ class OneClickSigninBubbleView : public views::BubbleDelegateView,
|
| protected:
|
| // Creates a OneClickSigninBubbleView.
|
| OneClickSigninBubbleView(
|
| + content::WebContents* web_contents,
|
| views::View* anchor_view,
|
| - const BrowserWindow::StartSyncCallback& start_sync_callback);
|
| + const string16& error_message,
|
| + const string16& email,
|
| + const BrowserWindow::StartSyncCallback& start_sync_callback,
|
| + bool is_sync_dialog);
|
|
|
| virtual ~OneClickSigninBubbleView();
|
|
|
| + private:
|
| + friend class OneClickSigninBubbleViewBrowserTest;
|
| +
|
| + 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);
|
| +
|
| + // Overridden from views::BubbleDelegateView:
|
| + virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
|
| + virtual void Init() OVERRIDE;
|
| +
|
| // Overridden from views::LinkListener:
|
| virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
|
|
|
| @@ -63,60 +90,66 @@ class OneClickSigninBubbleView : public views::BubbleDelegateView,
|
| virtual void ButtonPressed(views::Button* sender,
|
| const ui::Event& event) OVERRIDE;
|
|
|
| - // views::View method:
|
| + // Overridden from views::View:
|
| virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
|
|
|
| - views::Link* GetAdvancedLink();
|
| - views::Button* GetOkButton();
|
| - views::Button* GetUndoButton();
|
| -
|
| - private:
|
| - friend class OneClickSigninBubbleViewBrowserTest;
|
| -
|
| - FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleViewBrowserTest, OkButton);
|
| - FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleViewBrowserTest, UndoButton);
|
| - FRIEND_TEST_ALL_PREFIXES(OneClickSigninBubbleViewBrowserTest, AdvancedLink);
|
| + // Overridden from views::WidgetDelegate:
|
| + virtual void WindowClosing() OVERRIDE;
|
| + virtual ui::ModalType GetModalType() const OVERRIDE;
|
|
|
| - // views::BubbleDelegateView methods:
|
| - virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
|
| - virtual void Init() OVERRIDE;
|
| + // Builds a popup bubble anchored under the wrench menu
|
| + void InitBubbleContent(views::GridLayout* layout);
|
|
|
| - // Method to build the main part of the bubble. Derived classes should
|
| - // reimplement this function.
|
| - virtual void InitContent(views::GridLayout* layout);
|
| + // Builds a modal dialog aligned center top
|
| + void InitDialogContent(views::GridLayout* layout);
|
|
|
| - // Creates OK and Undo buttons to be used at the bottom of the bubble.
|
| - // 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,
|
| + // Initializes the OK/Undo buttons to be used at the bottom of the bubble.
|
| + void InitButtons(views::GridLayout* layout);
|
| + void GetButtons(views::LabelButton** ok_button,
|
| views::LabelButton** undo_button);
|
|
|
| + // Creates learn more link to be used at the bottom of the bubble.
|
| + void InitLearnMoreLink();
|
| +
|
| // 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* CreateAdvancedLink();
|
| + void InitAdvancedLink();
|
|
|
| - // views::WidgetDelegate method:
|
| - virtual void WindowClosing() OVERRIDE;
|
| + // The bubble/dialog will always outlive the web_content, so this is ok
|
| + content::WebContents* web_contents_;
|
|
|
| - // The bubble, if we're showing one.
|
| - static OneClickSigninBubbleView* bubble_view_;
|
| + // Alternate error message to be displayed
|
| + const string16 error_message_;
|
| +
|
| + const string16 email_;
|
| +
|
| + // 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_;
|
| +
|
| + const bool is_sync_dialog_;
|
|
|
| // 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_;
|
|
|
| - // 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_;
|
| + // Close button for the modal dialog
|
| + views::ImageButton* close_button_;
|
| +
|
| + bool clicked_learn_more_;
|
|
|
| // A message loop used only with unit tests.
|
| base::MessageLoop* message_loop_for_testing_;
|
|
|
| + // The bubble, if we're showing one.
|
| + static OneClickSigninBubbleView* bubble_view_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleView);
|
| };
|
|
|
|
|