| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 new views::StyledLabel(signin_explanation_text, this); | 195 new views::StyledLabel(signin_explanation_text, this); |
| 196 explanation_label->AddStyleRange( | 196 explanation_label->AddStyleRange( |
| 197 gfx::Range(offsets[1], offsets[1] + learn_more_text.size()), | 197 gfx::Range(offsets[1], offsets[1] + learn_more_text.size()), |
| 198 views::StyledLabel::RangeStyleInfo::CreateForLink()); | 198 views::StyledLabel::RangeStyleInfo::CreateForLink()); |
| 199 | 199 |
| 200 // Layout the components. | 200 // Layout the components. |
| 201 const gfx::Insets panel_insets = | 201 const gfx::Insets panel_insets = |
| 202 views::LayoutProvider::Get()->GetInsetsMetric(views::INSETS_PANEL); | 202 views::LayoutProvider::Get()->GetInsetsMetric(views::INSETS_PANEL); |
| 203 // The prompt bar needs to go to the edge of the dialog, so ignore insets for | 203 // The prompt bar needs to go to the edge of the dialog, so ignore insets for |
| 204 // the outer layout. | 204 // the outer layout. |
| 205 SetBorder(views::CreateEmptyBorder(panel_insets.top(), 0, |
| 206 panel_insets.bottom(), 0)); |
| 205 views::GridLayout* dialog_layout = new views::GridLayout(this); | 207 views::GridLayout* dialog_layout = new views::GridLayout(this); |
| 206 dialog_layout->SetInsets(panel_insets.top(), 0, panel_insets.bottom(), 0); | |
| 207 SetLayoutManager(dialog_layout); | 208 SetLayoutManager(dialog_layout); |
| 208 | 209 |
| 209 // Use GridLayout inside the prompt bar because StyledLabel requires it. | 210 // Use GridLayout inside the prompt bar because StyledLabel requires it. |
| 210 views::GridLayout* prompt_layout = views::GridLayout::CreatePanel(prompt_bar); | 211 views::GridLayout* prompt_layout = views::GridLayout::CreatePanel(prompt_bar); |
| 211 constexpr int kPromptBarColumnSetId = 0; | 212 constexpr int kPromptBarColumnSetId = 0; |
| 212 prompt_layout->AddColumnSet(kPromptBarColumnSetId) | 213 prompt_layout->AddColumnSet(kPromptBarColumnSetId) |
| 213 ->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 100, | 214 ->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 100, |
| 214 views::GridLayout::USE_PREF, 0, 0); | 215 views::GridLayout::USE_PREF, 0, 0); |
| 215 prompt_layout->StartRow(0, kPromptBarColumnSetId); | 216 prompt_layout->StartRow(0, kPromptBarColumnSetId); |
| 216 prompt_layout->AddView(prompt_label); | 217 prompt_layout->AddView(prompt_label); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 void ProfileSigninConfirmationDialogViews::ButtonPressed( | 261 void ProfileSigninConfirmationDialogViews::ButtonPressed( |
| 261 views::Button* sender, | 262 views::Button* sender, |
| 262 const ui::Event& event) { | 263 const ui::Event& event) { |
| 263 DCHECK(prompt_for_new_profile_); | 264 DCHECK(prompt_for_new_profile_); |
| 264 if (delegate_) { | 265 if (delegate_) { |
| 265 delegate_->OnContinueSignin(); | 266 delegate_->OnContinueSignin(); |
| 266 delegate_ = nullptr; | 267 delegate_ = nullptr; |
| 267 } | 268 } |
| 268 GetWidget()->Close(); | 269 GetWidget()->Close(); |
| 269 } | 270 } |
| OLD | NEW |