| 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_SIGNIN_VIEW_CONTROLLER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_SIGNIN_VIEW_CONTROLLER_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_SIGNIN_VIEW_CONTROLLER_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_SIGNIN_VIEW_CONTROLLER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/ui/profile_chooser_constants.h" | 8 #include "chrome/browser/ui/profile_chooser_constants.h" |
| 9 #include "content/public/browser/web_contents_delegate.h" | 9 #include "content/public/browser/web_contents_delegate.h" |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 profiles::BubbleViewMode mode, | 29 profiles::BubbleViewMode mode, |
| 30 Browser* browser, | 30 Browser* browser, |
| 31 signin_metrics::AccessPoint access_point); | 31 signin_metrics::AccessPoint access_point); |
| 32 | 32 |
| 33 static SigninViewControllerDelegate* CreateSyncConfirmationDelegate( | 33 static SigninViewControllerDelegate* CreateSyncConfirmationDelegate( |
| 34 SigninViewController* signin_view_controller, | 34 SigninViewController* signin_view_controller, |
| 35 Browser* browser); | 35 Browser* browser); |
| 36 | 36 |
| 37 void CloseModalSignin(); | 37 void CloseModalSignin(); |
| 38 | 38 |
| 39 // Either navigates back in the signin flow if the history state allows it or |
| 40 // closes the flow otherwise. |
| 41 void PerformNavigation(); |
| 42 |
| 43 // This will be called by the base class to request a resize of the native |
| 44 // view hosting the content to |height|. |height| is the total height of the |
| 45 // content, in pixels. |
| 46 virtual void ResizeNativeView(int height) = 0; |
| 47 |
| 39 protected: | 48 protected: |
| 40 SigninViewControllerDelegate(SigninViewController* signin_view_controller, | 49 SigninViewControllerDelegate(SigninViewController* signin_view_controller, |
| 41 content::WebContents* web_contents); | 50 content::WebContents* web_contents); |
| 42 ~SigninViewControllerDelegate() override; | 51 ~SigninViewControllerDelegate() override; |
| 43 | 52 |
| 44 // Notifies the SigninViewController that this instance is being deleted. | 53 // Notifies the SigninViewController that this instance is being deleted. |
| 45 void ResetSigninViewControllerDelegate(); | 54 void ResetSigninViewControllerDelegate(); |
| 46 | 55 |
| 47 // content::WebContentsDelegate | 56 // content::WebContentsDelegate |
| 48 void LoadingStateChanged(content::WebContents* source, | 57 void LoadingStateChanged(content::WebContents* source, |
| 49 bool to_different_document) override; | 58 bool to_different_document) override; |
| 50 | 59 |
| 51 // Handles the web ui message sent when the navigation button is clicked by | |
| 52 // the user, requesting either a back navigation or closing the dialog. | |
| 53 void HandleNavigationButtonClicked(const base::ListValue* args); | |
| 54 | |
| 55 // This will be called by this base class when the tab-modal window must be | 60 // This will be called by this base class when the tab-modal window must be |
| 56 // closed. This should close the platform-specific window that is currently | 61 // closed. This should close the platform-specific window that is currently |
| 57 // showing the sign in flow or the sync confirmation dialog. | 62 // showing the sign in flow or the sync confirmation dialog. |
| 58 virtual void PerformClose() = 0; | 63 virtual void PerformClose() = 0; |
| 59 | 64 |
| 60 private: | 65 private: |
| 61 bool CanGoBack(content::WebContents* web_ui_web_contents) const; | 66 bool CanGoBack(content::WebContents* web_ui_web_contents) const; |
| 62 | 67 |
| 63 SigninViewController* signin_view_controller_; // Not owned. | 68 SigninViewController* signin_view_controller_; // Not owned. |
| 64 content::WebContents* web_contents_; // Not owned. | 69 content::WebContents* web_contents_; // Not owned. |
| 65 DISALLOW_COPY_AND_ASSIGN(SigninViewControllerDelegate); | 70 DISALLOW_COPY_AND_ASSIGN(SigninViewControllerDelegate); |
| 66 }; | 71 }; |
| 67 | 72 |
| 68 #endif // CHROME_BROWSER_UI_SIGNIN_VIEW_CONTROLLER_DELEGATE_H_ | 73 #endif // CHROME_BROWSER_UI_SIGNIN_VIEW_CONTROLLER_DELEGATE_H_ |
| OLD | NEW |