| 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 #include "chrome/browser/ui/signin_view_controller_delegate.h" | 5 #include "chrome/browser/ui/signin_view_controller_delegate.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/ui/signin_view_controller.h" | 9 #include "chrome/browser/ui/signin_view_controller.h" |
| 10 #include "chrome/browser/ui/webui/signin/get_auth_frame.h" | 10 #include "chrome/browser/ui/webui/signin/get_auth_frame.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 content::WebContents* web_ui_web_contents) const { | 45 content::WebContents* web_ui_web_contents) const { |
| 46 auto auth_web_contents = GetAuthFrameWebContents(web_ui_web_contents); | 46 auto auth_web_contents = GetAuthFrameWebContents(web_ui_web_contents); |
| 47 return auth_web_contents && auth_web_contents->GetController().CanGoBack(); | 47 return auth_web_contents && auth_web_contents->GetController().CanGoBack(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 // content::WebContentsDelegate | 50 // content::WebContentsDelegate |
| 51 void SigninViewControllerDelegate::LoadingStateChanged( | 51 void SigninViewControllerDelegate::LoadingStateChanged( |
| 52 content::WebContents* source, | 52 content::WebContents* source, |
| 53 bool to_different_document) { | 53 bool to_different_document) { |
| 54 if (CanGoBack(source)) | 54 if (CanGoBack(source)) |
| 55 source->GetWebUI()->CallJavascriptFunction("inline.login.showBackButton"); | 55 source->GetWebUI()->CallJavascriptFunctionUnsafe( |
| 56 "inline.login.showBackButton"); |
| 56 else | 57 else |
| 57 source->GetWebUI()->CallJavascriptFunction("inline.login.showCloseButton"); | 58 source->GetWebUI()->CallJavascriptFunctionUnsafe( |
| 59 "inline.login.showCloseButton"); |
| 58 } | 60 } |
| 59 | 61 |
| 60 void SigninViewControllerDelegate::PerformNavigation() { | 62 void SigninViewControllerDelegate::PerformNavigation() { |
| 61 if (CanGoBack(web_contents_)) { | 63 if (CanGoBack(web_contents_)) { |
| 62 auto auth_web_contents = GetAuthFrameWebContents(web_contents_); | 64 auto auth_web_contents = GetAuthFrameWebContents(web_contents_); |
| 63 auth_web_contents->GetController().GoBack(); | 65 auth_web_contents->GetController().GoBack(); |
| 64 } else { | 66 } else { |
| 65 CloseModalSignin(); | 67 CloseModalSignin(); |
| 66 } | 68 } |
| 67 } | 69 } |
| OLD | NEW |