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

Side by Side Diff: chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.h

Issue 1814513002: Fix sizing issues in the tab modal signin flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_VIEWS_H _ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_VIEWS_H _
6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_VIEWS_H _ 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_VIEWS_H _
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/ui/profile_chooser_constants.h" 9 #include "chrome/browser/ui/profile_chooser_constants.h"
10 #include "chrome/browser/ui/signin_view_controller_delegate.h" 10 #include "chrome/browser/ui/signin_view_controller_delegate.h"
(...skipping 14 matching lines...) Expand all
25 class WebView; 25 class WebView;
26 } 26 }
27 27
28 // Views implementation of SigninViewControllerDelegate. It's responsible for 28 // Views implementation of SigninViewControllerDelegate. It's responsible for
29 // managing the Signin and Sync Confirmation tab-modal dialogs. 29 // managing the Signin and Sync Confirmation tab-modal dialogs.
30 // Instances of this class delete themselves when the window they're managing 30 // Instances of this class delete themselves when the window they're managing
31 // closes (in the DeleteDelegate callback). 31 // closes (in the DeleteDelegate callback).
32 class SigninViewControllerDelegateViews : public views::DialogDelegateView, 32 class SigninViewControllerDelegateViews : public views::DialogDelegateView,
33 public SigninViewControllerDelegate { 33 public SigninViewControllerDelegate {
34 public: 34 public:
35 // Creates and displays a constrained window containing |web_contents|. If
36 // |wait_for_size| is true, the delegate will wait for ResizeNativeView() to
37 // be called by the base class before displaying the constrained window.
35 SigninViewControllerDelegateViews( 38 SigninViewControllerDelegateViews(
36 SigninViewController* signin_view_controller, 39 SigninViewController* signin_view_controller,
37 views::WebView* content_view, 40 views::WebView* content_view,
38 Browser* browser); 41 Browser* browser,
42 bool wait_for_size);
39 43
40 // Creates the web view that contains the signin flow in |mode| using 44 // Creates the web view that contains the signin flow in |mode| using
41 // |profile| as the web content's profile, then sets |delegate| as the created 45 // |profile| as the web content's profile, then sets |delegate| as the created
42 // web content's delegate. 46 // web content's delegate.
43 static views::WebView* CreateGaiaWebView( 47 static views::WebView* CreateGaiaWebView(
44 content::WebContentsDelegate* delegate, 48 content::WebContentsDelegate* delegate,
45 profiles::BubbleViewMode mode, 49 profiles::BubbleViewMode mode,
46 Profile* profile, 50 Profile* profile,
47 signin_metrics::AccessPoint access_point); 51 signin_metrics::AccessPoint access_point);
48 52
49 static views::WebView* CreateSyncConfirmationWebView(Profile* profile); 53 static views::WebView* CreateSyncConfirmationWebView(Profile* profile);
50 54
51 // views::DialogDelegateView: 55 // views::DialogDelegateView:
52 views::View* GetContentsView() override; 56 views::View* GetContentsView() override;
53 views::Widget* GetWidget() override; 57 views::Widget* GetWidget() override;
54 const views::Widget* GetWidget() const override; 58 const views::Widget* GetWidget() const override;
55 void DeleteDelegate() override; 59 void DeleteDelegate() override;
56 ui::ModalType GetModalType() const override; 60 ui::ModalType GetModalType() const override;
57 bool ShouldShowCloseButton() const override; 61 bool ShouldShowCloseButton() const override;
58 int GetDialogButtons() const override; 62 int GetDialogButtons() const override;
59 63
60 private: 64 private:
61 void PerformClose() override; 65 void PerformClose() override;
66 void ResizeNativeView(int height) override;
67
68 void DisplayModal();
62 69
63 ~SigninViewControllerDelegateViews() override; 70 ~SigninViewControllerDelegateViews() override;
64 71
65 views::WebView* content_view_; 72 views::WebView* content_view_;
66 views::Widget* modal_signin_widget_; // Not owned. 73 views::Widget* modal_signin_widget_; // Not owned.
67 74
75 // wait_for_size_ stores whether the dialog should only be shown after its
76 // content's size has been laid out and measured so that the constrained
77 // window is sized to the content.
78 bool wait_for_size_;
79 Browser* browser_;
80
68 DISALLOW_COPY_AND_ASSIGN(SigninViewControllerDelegateViews); 81 DISALLOW_COPY_AND_ASSIGN(SigninViewControllerDelegateViews);
69 }; 82 };
70 83
71 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_VIEW S_H_ 84 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_VIEW S_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698