Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Deleted LayoutDelegate and HarmonyLayoutDelegate. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_navigator.h" 13 #include "chrome/browser/ui/browser_navigator.h"
14 #include "chrome/browser/ui/browser_navigator_params.h" 14 #include "chrome/browser/ui/browser_navigator_params.h"
15 #include "chrome/browser/ui/browser_window.h" 15 #include "chrome/browser/ui/browser_window.h"
16 #include "chrome/browser/ui/views/harmony/layout_delegate.h" 16 #include "chrome/browser/ui/views/harmony/chrome_views_layout_delegate.h"
17 #include "chrome/grit/chromium_strings.h" 17 #include "chrome/grit/chromium_strings.h"
18 #include "chrome/grit/generated_resources.h" 18 #include "chrome/grit/generated_resources.h"
19 #include "components/constrained_window/constrained_window_views.h" 19 #include "components/constrained_window/constrained_window_views.h"
20 #include "components/signin/core/common/profile_management_switches.h" 20 #include "components/signin/core/common/profile_management_switches.h"
21 #include "content/public/browser/web_contents.h" 21 #include "content/public/browser/web_contents.h"
22 #include "google_apis/gaia/gaia_auth_util.h" 22 #include "google_apis/gaia/gaia_auth_util.h"
23 #include "third_party/skia/include/core/SkColor.h" 23 #include "third_party/skia/include/core/SkColor.h"
24 #include "ui/base/l10n/l10n_util.h" 24 #include "ui/base/l10n/l10n_util.h"
25 #include "ui/base/ui_features.h" 25 #include "ui/base/ui_features.h"
26 #include "ui/gfx/font.h" 26 #include "ui/gfx/font.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 IDS_ENTERPRISE_SIGNIN_EXPLANATION_WITH_PROFILE_CREATION : 187 IDS_ENTERPRISE_SIGNIN_EXPLANATION_WITH_PROFILE_CREATION :
188 IDS_ENTERPRISE_SIGNIN_EXPLANATION_WITHOUT_PROFILE_CREATION, 188 IDS_ENTERPRISE_SIGNIN_EXPLANATION_WITHOUT_PROFILE_CREATION,
189 username, learn_more_text, &offsets); 189 username, learn_more_text, &offsets);
190 views::StyledLabel* explanation_label = 190 views::StyledLabel* explanation_label =
191 new views::StyledLabel(signin_explanation_text, this); 191 new views::StyledLabel(signin_explanation_text, this);
192 explanation_label->AddStyleRange( 192 explanation_label->AddStyleRange(
193 gfx::Range(offsets[1], offsets[1] + learn_more_text.size()), 193 gfx::Range(offsets[1], offsets[1] + learn_more_text.size()),
194 views::StyledLabel::RangeStyleInfo::CreateForLink()); 194 views::StyledLabel::RangeStyleInfo::CreateForLink());
195 195
196 // Layout the components. 196 // Layout the components.
197 const int panel_margin = LayoutDelegate::Get()->GetMetric( 197 const int panel_margin = ChromeViewsLayoutDelegate::Get()->GetDistanceMetric(
198 LayoutDelegate::Metric::PANEL_CONTENT_MARGIN); 198 ChromeDistanceMetric::PANEL_CONTENT_MARGIN);
199 views::GridLayout* dialog_layout = new views::GridLayout(this); 199 views::GridLayout* dialog_layout = new views::GridLayout(this);
200 dialog_layout->SetInsets(panel_margin, 0, 0, 0); 200 dialog_layout->SetInsets(panel_margin, 0, 0, 0);
201 SetLayoutManager(dialog_layout); 201 SetLayoutManager(dialog_layout);
202 202
203 // Use GridLayout inside the prompt bar because StyledLabel requires it. 203 // Use GridLayout inside the prompt bar because StyledLabel requires it.
204 views::GridLayout* prompt_layout = views::GridLayout::CreatePanel(prompt_bar); 204 views::GridLayout* prompt_layout = views::GridLayout::CreatePanel(prompt_bar);
205 prompt_bar->SetLayoutManager(prompt_layout); 205 prompt_bar->SetLayoutManager(prompt_layout);
206 prompt_layout->AddColumnSet(0)->AddColumn( 206 prompt_layout->AddColumnSet(0)->AddColumn(
207 views::GridLayout::FILL, views::GridLayout::CENTER, 100, 207 views::GridLayout::FILL, views::GridLayout::CENTER, 100,
208 views::GridLayout::USE_PREF, 0, 0); 208 views::GridLayout::USE_PREF, 0, 0);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 void ProfileSigninConfirmationDialogViews::ButtonPressed( 252 void ProfileSigninConfirmationDialogViews::ButtonPressed(
253 views::Button* sender, 253 views::Button* sender,
254 const ui::Event& event) { 254 const ui::Event& event) {
255 DCHECK(prompt_for_new_profile_); 255 DCHECK(prompt_for_new_profile_);
256 if (delegate_) { 256 if (delegate_) {
257 delegate_->OnContinueSignin(); 257 delegate_->OnContinueSignin();
258 delegate_ = nullptr; 258 delegate_ = nullptr;
259 } 259 }
260 GetWidget()->Close(); 260 GetWidget()->Close();
261 } 261 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698