Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_COCOA_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_MAC_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_MAC_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 // Cocoa implementation of SigninViewControllerDelegate. It's responsible for | 29 // Cocoa implementation of SigninViewControllerDelegate. It's responsible for |
| 30 // managing the Signin and Sync Confirmation tab-modal dialogs. | 30 // managing the Signin and Sync Confirmation tab-modal dialogs. |
| 31 // Instances of this class delete themselves when the window they manage is | 31 // Instances of this class delete themselves when the window they manage is |
| 32 // closed (in the OnConstrainedWindowClosed callback). | 32 // closed (in the OnConstrainedWindowClosed callback). |
| 33 class SigninViewControllerDelegateMac : public ConstrainedWindowMacDelegate, | 33 class SigninViewControllerDelegateMac : public ConstrainedWindowMacDelegate, |
| 34 public SigninViewControllerDelegate { | 34 public SigninViewControllerDelegate { |
| 35 public: | 35 public: |
| 36 SigninViewControllerDelegateMac(SigninViewController* signin_view_controller, | 36 SigninViewControllerDelegateMac(SigninViewController* signin_view_controller, |
| 37 scoped_ptr<content::WebContents> web_contents, | 37 scoped_ptr<content::WebContents> web_contents, |
| 38 content::WebContents* host_web_contents, | 38 content::WebContents* host_web_contents, |
| 39 NSRect frame); | 39 NSRect frame, |
| 40 bool wait_for_size); | |
| 40 | 41 |
| 41 static | 42 static |
| 42 SigninViewControllerDelegateMac* CreateModalSigninDelegateWithNavigation( | 43 SigninViewControllerDelegateMac* CreateModalSigninDelegateWithNavigation( |
| 43 SigninViewController* signin_view_controller, | 44 SigninViewController* signin_view_controller, |
| 44 scoped_ptr<content::WebContents> web_contents, | 45 scoped_ptr<content::WebContents> web_contents, |
| 45 content::WebContents* host_web_contents, | 46 content::WebContents* host_web_contents, |
| 46 NSRect frame); | 47 NSRect frame); |
| 47 | 48 |
| 48 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override; | 49 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override; |
| 49 | 50 |
| 50 // Creates the web view that contains the signin flow in |mode| using | 51 // Creates the web view that contains the signin flow in |mode| using |
| 51 // |profile| as the web content's profile, then sets |delegate| as the created | 52 // |profile| as the web content's profile, then sets |delegate| as the created |
| 52 // web content's delegate. | 53 // web content's delegate. |
| 53 static scoped_ptr<content::WebContents> CreateGaiaWebContents( | 54 static scoped_ptr<content::WebContents> CreateGaiaWebContents( |
| 54 content::WebContentsDelegate* delegate, | 55 content::WebContentsDelegate* delegate, |
| 55 profiles::BubbleViewMode mode, | 56 profiles::BubbleViewMode mode, |
| 56 Profile* profile, | 57 Profile* profile, |
| 57 signin_metrics::AccessPoint access_point); | 58 signin_metrics::AccessPoint access_point); |
| 58 | 59 |
| 59 static scoped_ptr<content::WebContents> CreateSyncConfirmationWebContents( | 60 static scoped_ptr<content::WebContents> CreateSyncConfirmationWebContents( |
| 60 Profile* profile); | 61 Profile* profile); |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 void PerformClose() override; | 64 void PerformClose() override; |
| 65 void ResizeNativeView(int height) override; | |
| 66 | |
| 67 void DisplayModal(); | |
| 64 | 68 |
| 65 ~SigninViewControllerDelegateMac() override; | 69 ~SigninViewControllerDelegateMac() override; |
| 66 | 70 |
| 67 scoped_ptr<ConstrainedWindowMac> constrained_window_; | 71 scoped_ptr<ConstrainedWindowMac> constrained_window_; |
| 68 scoped_ptr<content::WebContents> web_contents_; | 72 scoped_ptr<content::WebContents> web_contents_; |
| 69 base::scoped_nsobject<ConstrainedWindowCustomWindow> window_; | 73 base::scoped_nsobject<ConstrainedWindowCustomWindow> window_; |
| 70 | 74 |
| 75 bool wait_for_size_; | |
|
Robert Sesek
2016/04/04 14:54:34
Can you document what these variables are? It's no
anthonyvd
2016/04/04 20:35:24
Done.
| |
| 76 content::WebContents* host_web_contents_; | |
| 77 NSRect window_frame_; | |
| 78 | |
| 71 DISALLOW_COPY_AND_ASSIGN(SigninViewControllerDelegateMac); | 79 DISALLOW_COPY_AND_ASSIGN(SigninViewControllerDelegateMac); |
| 72 }; | 80 }; |
| 73 | 81 |
| 74 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_MAC_ H_ | 82 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_MAC_ H_ |
| OLD | NEW |