| 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 25 matching lines...) Expand all Loading... |
| 36 // Creates and displays a constrained window off of |host_web_contents|, | 36 // Creates and displays a constrained window off of |host_web_contents|, |
| 37 // containing |web_contents|. If |wait_for_size| is true, the delegate will | 37 // containing |web_contents|. If |wait_for_size| is true, the delegate will |
| 38 // wait for ResizeNativeView() to be called by the base class before | 38 // wait for ResizeNativeView() to be called by the base class before |
| 39 // displaying the constrained window. Otherwise, the window's dimensions will | 39 // displaying the constrained window. Otherwise, the window's dimensions will |
| 40 // be |frame|. | 40 // be |frame|. |
| 41 SigninViewControllerDelegateMac( | 41 SigninViewControllerDelegateMac( |
| 42 SigninViewController* signin_view_controller, | 42 SigninViewController* signin_view_controller, |
| 43 std::unique_ptr<content::WebContents> web_contents, | 43 std::unique_ptr<content::WebContents> web_contents, |
| 44 content::WebContents* host_web_contents, | 44 content::WebContents* host_web_contents, |
| 45 NSRect frame, | 45 NSRect frame, |
| 46 DialogModalType dialog_modal_type, |
| 46 bool wait_for_size); | 47 bool wait_for_size); |
| 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 std::unique_ptr<content::WebContents> CreateGaiaWebContents( | 54 static std::unique_ptr<content::WebContents> CreateGaiaWebContents( |
| 54 content::WebContentsDelegate* delegate, | 55 content::WebContentsDelegate* delegate, |
| 55 profiles::BubbleViewMode mode, | 56 profiles::BubbleViewMode mode, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 67 void ResizeNativeView(int height) override; | 68 void ResizeNativeView(int height) override; |
| 68 | 69 |
| 69 void DisplayModal(); | 70 void DisplayModal(); |
| 70 | 71 |
| 71 void HandleKeyboardEvent( | 72 void HandleKeyboardEvent( |
| 72 content::WebContents* source, | 73 content::WebContents* source, |
| 73 const content::NativeWebKeyboardEvent& event) override; | 74 const content::NativeWebKeyboardEvent& event) override; |
| 74 | 75 |
| 75 ~SigninViewControllerDelegateMac() override; | 76 ~SigninViewControllerDelegateMac() override; |
| 76 | 77 |
| 78 // Called to delete |this|. |
| 79 void DeleteThis(); |
| 80 |
| 77 // The constrained window opened by this delegate to display signin flow | 81 // The constrained window opened by this delegate to display signin flow |
| 78 // content. | 82 // content. |
| 79 std::unique_ptr<ConstrainedWindowMac> constrained_window_; | 83 std::unique_ptr<ConstrainedWindowMac> constrained_window_; |
| 80 | 84 |
| 81 // The web contents displayed in the constrained window. | 85 // The web contents displayed in the constrained window. |
| 82 std::unique_ptr<content::WebContents> web_contents_; | 86 std::unique_ptr<content::WebContents> web_contents_; |
| 83 base::scoped_nsobject<ConstrainedWindowCustomWindow> window_; | 87 base::scoped_nsobject<ConstrainedWindowCustomWindow> window_; |
| 84 | 88 |
| 85 // wait_for_size_ stores whether the dialog should only be shown after its | 89 // wait_for_size_ stores whether the dialog should only be shown after its |
| 86 // content's size has been laid out and measured so that the constrained | 90 // content's size has been laid out and measured so that the constrained |
| 87 // window is sized to the content. | 91 // window is sized to the content. |
| 88 bool wait_for_size_; | 92 bool wait_for_size_; |
| 89 | 93 |
| 90 // The web contents that the constrained window is displayed off of. | 94 // The web contents that the constrained window is displayed off of. |
| 91 // Typically, this is going to be the active tab when the window is shown. | 95 // Typically, this is going to be the active tab when the window is shown. |
| 92 content::WebContents* host_web_contents_; | 96 content::WebContents* host_web_contents_; |
| 97 |
| 98 // The dialog modal presentation type. |
| 99 DialogModalType dialog_modal_type_; |
| 100 |
| 93 NSRect window_frame_; | 101 NSRect window_frame_; |
| 94 | 102 |
| 95 DISALLOW_COPY_AND_ASSIGN(SigninViewControllerDelegateMac); | 103 DISALLOW_COPY_AND_ASSIGN(SigninViewControllerDelegateMac); |
| 96 }; | 104 }; |
| 97 | 105 |
| 98 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_MAC_
H_ | 106 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_SIGNIN_VIEW_CONTROLLER_DELEGATE_MAC_
H_ |
| OLD | NEW |