| 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/views/profiles/signin_view_controller_delegate_views
.h" | 5 #include "chrome/browser/ui/views/profiles/signin_view_controller_delegate_views
.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 9 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
| 10 #include "chrome/browser/signin/signin_promo.h" | 10 #include "chrome/browser/signin/signin_promo.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 bool SigninViewControllerDelegateViews::ShouldShowCloseButton() const { | 68 bool SigninViewControllerDelegateViews::ShouldShowCloseButton() const { |
| 69 return false; | 69 return false; |
| 70 } | 70 } |
| 71 | 71 |
| 72 int SigninViewControllerDelegateViews::GetDialogButtons() const { | 72 int SigninViewControllerDelegateViews::GetDialogButtons() const { |
| 73 return ui::DIALOG_BUTTON_NONE; | 73 return ui::DIALOG_BUTTON_NONE; |
| 74 } | 74 } |
| 75 | 75 |
| 76 void SigninViewControllerDelegateViews::PerformClose() { | 76 void SigninViewControllerDelegateViews::PerformClose() { |
| 77 modal_signin_widget_->Close(); | 77 if (modal_signin_widget_) |
| 78 modal_signin_widget_->Close(); |
| 78 } | 79 } |
| 79 | 80 |
| 80 void SigninViewControllerDelegateViews::ResizeNativeView(int height) { | 81 void SigninViewControllerDelegateViews::ResizeNativeView(int height) { |
| 81 int max_height = browser_ | 82 int max_height = browser_ |
| 82 ->window() | 83 ->window() |
| 83 ->GetWebContentsModalDialogHost() | 84 ->GetWebContentsModalDialogHost() |
| 84 ->GetMaximumDialogSize().height(); | 85 ->GetMaximumDialogSize().height(); |
| 85 content_view_->SetPreferredSize( | 86 content_view_->SetPreferredSize( |
| 86 gfx::Size(kModalDialogWidth, std::min(height, max_height))); | 87 gfx::Size(kModalDialogWidth, std::min(height, max_height))); |
| 87 content_view_->Layout(); | 88 content_view_->Layout(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 168 |
| 168 SigninViewControllerDelegate* | 169 SigninViewControllerDelegate* |
| 169 SigninViewControllerDelegate::CreateSyncConfirmationDelegate( | 170 SigninViewControllerDelegate::CreateSyncConfirmationDelegate( |
| 170 SigninViewController* signin_view_controller, | 171 SigninViewController* signin_view_controller, |
| 171 Browser* browser) { | 172 Browser* browser) { |
| 172 return new SigninViewControllerDelegateViews( | 173 return new SigninViewControllerDelegateViews( |
| 173 signin_view_controller, | 174 signin_view_controller, |
| 174 SigninViewControllerDelegateViews::CreateSyncConfirmationWebView(browser), | 175 SigninViewControllerDelegateViews::CreateSyncConfirmationWebView(browser), |
| 175 browser, true); | 176 browser, true); |
| 176 } | 177 } |
| OLD | NEW |