| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/sync/profile_signin_confirmation_dialog_views.
h" | 5 #include "chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.
h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool ProfileSigninConfirmationDialogViews::Cancel() { | 129 bool ProfileSigninConfirmationDialogViews::Cancel() { |
| 130 if (delegate_) { | 130 if (delegate_) { |
| 131 delegate_->OnCancelSignin(); | 131 delegate_->OnCancelSignin(); |
| 132 delegate_ = NULL; | 132 delegate_ = NULL; |
| 133 } | 133 } |
| 134 return true; | 134 return true; |
| 135 } | 135 } |
| 136 | 136 |
| 137 void ProfileSigninConfirmationDialogViews::OnClosed() { | |
| 138 Cancel(); | |
| 139 } | |
| 140 | |
| 141 ui::ModalType ProfileSigninConfirmationDialogViews::GetModalType() const { | 137 ui::ModalType ProfileSigninConfirmationDialogViews::GetModalType() const { |
| 142 return ui::MODAL_TYPE_WINDOW; | 138 return ui::MODAL_TYPE_WINDOW; |
| 143 } | 139 } |
| 144 | 140 |
| 145 void ProfileSigninConfirmationDialogViews::ViewHierarchyChanged( | 141 void ProfileSigninConfirmationDialogViews::ViewHierarchyChanged( |
| 146 const ViewHierarchyChangedDetails& details) { | 142 const ViewHierarchyChangedDetails& details) { |
| 147 views::DialogDelegateView::ViewHierarchyChanged(details); | 143 views::DialogDelegateView::ViewHierarchyChanged(details); |
| 148 if (!details.is_add || details.child != this) | 144 if (!details.is_add || details.child != this) |
| 149 return; | 145 return; |
| 150 | 146 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 views::GridLayout::USE_PREF, 0, 0); | 219 views::GridLayout::USE_PREF, 0, 0); |
| 224 explanation_columns->AddPaddingColumn(0.0, views::kButtonHEdgeMarginNew); | 220 explanation_columns->AddPaddingColumn(0.0, views::kButtonHEdgeMarginNew); |
| 225 dialog_layout->StartRow(0, 1); | 221 dialog_layout->StartRow(0, 1); |
| 226 const int kPreferredWidth = 440; | 222 const int kPreferredWidth = 440; |
| 227 dialog_layout->AddView( | 223 dialog_layout->AddView( |
| 228 explanation_label_, 1, 1, | 224 explanation_label_, 1, 1, |
| 229 views::GridLayout::FILL, views::GridLayout::FILL, | 225 views::GridLayout::FILL, views::GridLayout::FILL, |
| 230 kPreferredWidth, explanation_label_->GetHeightForWidth(kPreferredWidth)); | 226 kPreferredWidth, explanation_label_->GetHeightForWidth(kPreferredWidth)); |
| 231 } | 227 } |
| 232 | 228 |
| 229 void ProfileSigninConfirmationDialogViews::WindowClosing() { |
| 230 Cancel(); |
| 231 } |
| 232 |
| 233 void ProfileSigninConfirmationDialogViews::StyledLabelLinkClicked( | 233 void ProfileSigninConfirmationDialogViews::StyledLabelLinkClicked( |
| 234 views::StyledLabel* label, | 234 views::StyledLabel* label, |
| 235 const gfx::Range& range, | 235 const gfx::Range& range, |
| 236 int event_flags) { | 236 int event_flags) { |
| 237 chrome::NavigateParams params( | 237 chrome::NavigateParams params( |
| 238 browser_, | 238 browser_, |
| 239 GURL("https://support.google.com/chromebook/answer/1331549"), | 239 GURL("https://support.google.com/chromebook/answer/1331549"), |
| 240 ui::PAGE_TRANSITION_LINK); | 240 ui::PAGE_TRANSITION_LINK); |
| 241 params.disposition = NEW_POPUP; | 241 params.disposition = NEW_POPUP; |
| 242 params.window_action = chrome::NavigateParams::SHOW_WINDOW; | 242 params.window_action = chrome::NavigateParams::SHOW_WINDOW; |
| 243 chrome::Navigate(¶ms); | 243 chrome::Navigate(¶ms); |
| 244 } | 244 } |
| 245 | 245 |
| 246 void ProfileSigninConfirmationDialogViews::ButtonPressed( | 246 void ProfileSigninConfirmationDialogViews::ButtonPressed( |
| 247 views::Button* sender, | 247 views::Button* sender, |
| 248 const ui::Event& event) { | 248 const ui::Event& event) { |
| 249 DCHECK(prompt_for_new_profile_); | 249 DCHECK(prompt_for_new_profile_); |
| 250 DCHECK_EQ(continue_signin_button_, sender); | 250 DCHECK_EQ(continue_signin_button_, sender); |
| 251 if (delegate_) { | 251 if (delegate_) { |
| 252 delegate_->OnContinueSignin(); | 252 delegate_->OnContinueSignin(); |
| 253 delegate_ = NULL; | 253 delegate_ = NULL; |
| 254 } | 254 } |
| 255 GetWidget()->Close(); | 255 GetWidget()->Close(); |
| 256 } | 256 } |
| OLD | NEW |