| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 IDS_ENTERPRISE_SIGNIN_EXPLANATION_WITHOUT_PROFILE_CREATION_NEW_STYLE, | 181 IDS_ENTERPRISE_SIGNIN_EXPLANATION_WITHOUT_PROFILE_CREATION_NEW_STYLE, |
| 182 username, learn_more_text, &offsets); | 182 username, learn_more_text, &offsets); |
| 183 views::StyledLabel* explanation_label = | 183 views::StyledLabel* explanation_label = |
| 184 new views::StyledLabel(signin_explanation_text, this); | 184 new views::StyledLabel(signin_explanation_text, this); |
| 185 explanation_label->AddStyleRange( | 185 explanation_label->AddStyleRange( |
| 186 gfx::Range(offsets[1], offsets[1] + learn_more_text.size()), | 186 gfx::Range(offsets[1], offsets[1] + learn_more_text.size()), |
| 187 views::StyledLabel::RangeStyleInfo::CreateForLink()); | 187 views::StyledLabel::RangeStyleInfo::CreateForLink()); |
| 188 | 188 |
| 189 // Layout the components. | 189 // Layout the components. |
| 190 views::GridLayout* dialog_layout = new views::GridLayout(this); | 190 views::GridLayout* dialog_layout = new views::GridLayout(this); |
| 191 dialog_layout->SetInsets(views::kPanelVertMargin, 0, 0, 0); |
| 191 SetLayoutManager(dialog_layout); | 192 SetLayoutManager(dialog_layout); |
| 192 | 193 |
| 193 // Use GridLayout inside the prompt bar because StyledLabel requires it. | 194 // Use GridLayout inside the prompt bar because StyledLabel requires it. |
| 194 views::GridLayout* prompt_layout = views::GridLayout::CreatePanel(prompt_bar); | 195 views::GridLayout* prompt_layout = views::GridLayout::CreatePanel(prompt_bar); |
| 195 prompt_bar->SetLayoutManager(prompt_layout); | 196 prompt_bar->SetLayoutManager(prompt_layout); |
| 196 prompt_layout->AddColumnSet(0)->AddColumn( | 197 prompt_layout->AddColumnSet(0)->AddColumn( |
| 197 views::GridLayout::FILL, views::GridLayout::CENTER, 100, | 198 views::GridLayout::FILL, views::GridLayout::CENTER, 100, |
| 198 views::GridLayout::USE_PREF, 0, 0); | 199 views::GridLayout::USE_PREF, 0, 0); |
| 199 prompt_layout->StartRow(0, 0); | 200 prompt_layout->StartRow(0, 0); |
| 200 prompt_layout->AddView(prompt_label); | 201 prompt_layout->AddView(prompt_label); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 void ProfileSigninConfirmationDialogViews::ButtonPressed( | 243 void ProfileSigninConfirmationDialogViews::ButtonPressed( |
| 243 views::Button* sender, | 244 views::Button* sender, |
| 244 const ui::Event& event) { | 245 const ui::Event& event) { |
| 245 DCHECK(prompt_for_new_profile_); | 246 DCHECK(prompt_for_new_profile_); |
| 246 if (delegate_) { | 247 if (delegate_) { |
| 247 delegate_->OnContinueSignin(); | 248 delegate_->OnContinueSignin(); |
| 248 delegate_ = NULL; | 249 delegate_ = NULL; |
| 249 } | 250 } |
| 250 GetWidget()->Close(); | 251 GetWidget()->Close(); |
| 251 } | 252 } |
| OLD | NEW |