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 |
137 ui::ModalType ProfileSigninConfirmationDialogViews::GetModalType() const { | 141 ui::ModalType ProfileSigninConfirmationDialogViews::GetModalType() const { |
138 return ui::MODAL_TYPE_WINDOW; | 142 return ui::MODAL_TYPE_WINDOW; |
139 } | 143 } |
140 | 144 |
141 void ProfileSigninConfirmationDialogViews::ViewHierarchyChanged( | 145 void ProfileSigninConfirmationDialogViews::ViewHierarchyChanged( |
142 const ViewHierarchyChangedDetails& details) { | 146 const ViewHierarchyChangedDetails& details) { |
143 views::DialogDelegateView::ViewHierarchyChanged(details); | 147 views::DialogDelegateView::ViewHierarchyChanged(details); |
144 if (!details.is_add || details.child != this) | 148 if (!details.is_add || details.child != this) |
145 return; | 149 return; |
146 | 150 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 views::GridLayout::USE_PREF, 0, 0); | 223 views::GridLayout::USE_PREF, 0, 0); |
220 explanation_columns->AddPaddingColumn(0.0, views::kButtonHEdgeMarginNew); | 224 explanation_columns->AddPaddingColumn(0.0, views::kButtonHEdgeMarginNew); |
221 dialog_layout->StartRow(0, 1); | 225 dialog_layout->StartRow(0, 1); |
222 const int kPreferredWidth = 440; | 226 const int kPreferredWidth = 440; |
223 dialog_layout->AddView( | 227 dialog_layout->AddView( |
224 explanation_label_, 1, 1, | 228 explanation_label_, 1, 1, |
225 views::GridLayout::FILL, views::GridLayout::FILL, | 229 views::GridLayout::FILL, views::GridLayout::FILL, |
226 kPreferredWidth, explanation_label_->GetHeightForWidth(kPreferredWidth)); | 230 kPreferredWidth, explanation_label_->GetHeightForWidth(kPreferredWidth)); |
227 } | 231 } |
228 | 232 |
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 |