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

Side by Side Diff: chrome/browser/ui/views/sad_tab_view.cc

Issue 2713803002: Views/Harmony: Use LayoutDelegate::GetMetric for views::kPanelVertMargin. (Closed)
Patch Set: Fix many crashes. Created 3 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sad_tab_view.h" 5 #include "chrome/browser/ui/views/sad_tab_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 #include "chrome/app/vector_icons/vector_icons.h" 11 #include "chrome/app/vector_icons/vector_icons.h"
12 #include "chrome/browser/ui/views/harmony/layout_delegate.h"
12 #include "content/public/browser/web_contents.h" 13 #include "content/public/browser/web_contents.h"
13 #include "ui/base/l10n/l10n_util.h" 14 #include "ui/base/l10n/l10n_util.h"
14 #include "ui/base/resource/resource_bundle.h" 15 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/gfx/color_palette.h" 16 #include "ui/gfx/color_palette.h"
16 #include "ui/gfx/paint_vector_icon.h" 17 #include "ui/gfx/paint_vector_icon.h"
17 #include "ui/native_theme/common_theme.h" 18 #include "ui/native_theme/common_theme.h"
18 #include "ui/native_theme/native_theme.h" 19 #include "ui/native_theme/native_theme.h"
19 #include "ui/views/background.h" 20 #include "ui/views/background.h"
20 #include "ui/views/controls/button/md_text_button.h" 21 #include "ui/views/controls/button/md_text_button.h"
21 #include "ui/views/controls/image_view.h" 22 #include "ui/views/controls/image_view.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 const SkColor text_color = GetNativeTheme()->GetSystemColor( 73 const SkColor text_color = GetNativeTheme()->GetSystemColor(
73 ui::NativeTheme::kColorId_LabelDisabledColor); 74 ui::NativeTheme::kColorId_LabelDisabledColor);
74 75
75 message_ = CreateLabel(l10n_util::GetStringUTF16(GetMessage())); 76 message_ = CreateLabel(l10n_util::GetStringUTF16(GetMessage()));
76 77
77 message_->SetMultiLine(true); 78 message_->SetMultiLine(true);
78 message_->SetEnabledColor(text_color); 79 message_->SetEnabledColor(text_color);
79 message_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 80 message_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
80 message_->SetLineHeight(views::kPanelSubVerticalSpacing); 81 message_->SetLineHeight(views::kPanelSubVerticalSpacing);
81 82
82 layout->StartRowWithPadding(0, column_set_id, 0, views::kPanelVertMargin); 83 layout->StartRowWithPadding(
84 0, column_set_id, 0,
85 LayoutDelegate::Get()->GetMetric(
86 LayoutDelegate::Metric::PANEL_CONTENT_MARGIN));
tapted 2017/02/27 03:24:51 I don't think it makes sense for SadTabView to be
Peter Kasting 2017/02/28 02:21:39 Hmm. I agree this isn't a panel, but I kinda see
Patti Lor 2017/03/03 08:24:39 Had a look through all the metrics in LayoutDelega
Peter Kasting 2017/03/04 02:10:55 Well, "subsection" is supposed to refer to somethi
tapted 2017/03/06 02:20:32 I think this would be derived from BubbleFrameView
83 layout->AddView(message_, 2, 1, views::GridLayout::LEADING, 87 layout->AddView(message_, 2, 1, views::GridLayout::LEADING,
84 views::GridLayout::LEADING); 88 views::GridLayout::LEADING);
85 89
86 action_button_ = views::MdTextButton::CreateSecondaryUiBlueButton( 90 action_button_ = views::MdTextButton::CreateSecondaryUiBlueButton(
87 this, l10n_util::GetStringUTF16(GetButtonTitle())); 91 this, l10n_util::GetStringUTF16(GetButtonTitle()));
88 help_link_ = 92 help_link_ =
89 CreateLink(l10n_util::GetStringUTF16(GetHelpLinkTitle()), text_color); 93 CreateLink(l10n_util::GetStringUTF16(GetHelpLinkTitle()), text_color);
90 layout->StartRowWithPadding(0, column_set_id, 0, 94 layout->StartRowWithPadding(0, column_set_id, 0,
91 views::kPanelVerticalSpacing); 95 views::kPanelVerticalSpacing);
92 layout->AddView(help_link_, 1, 1, views::GridLayout::LEADING, 96 layout->AddView(help_link_, 1, 1, views::GridLayout::LEADING,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 169 }
166 170
167 namespace chrome { 171 namespace chrome {
168 172
169 SadTab* SadTab::Create(content::WebContents* web_contents, 173 SadTab* SadTab::Create(content::WebContents* web_contents,
170 SadTabKind kind) { 174 SadTabKind kind) {
171 return new SadTabView(web_contents, kind); 175 return new SadTabView(web_contents, kind);
172 } 176 }
173 177
174 } // namespace chrome 178 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698