Commit 26b852aa authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Give two kTextContext unique names for jumbo builds

There are two different kTextContexts in chrome/browser/ui, living
in different namespaces that in jumbo builds become the same
namespace. This patch renames them so that they have
unique names.

This affects Opera builds but not Chrome builds yet since jumbo
is not yet supported in chrome/browser/ui in Chrome.

Bug: 803406
Change-Id: I3354881b9dedae9499356800cbaed4de3cc0da4c
Reviewed-on: https://chromium-review.googlesource.com/966202Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#543938}
parent 98884077
...@@ -22,7 +22,7 @@ namespace { ...@@ -22,7 +22,7 @@ namespace {
// The labels here aren't really button labels, but we use CONTEXT_BUTTON to // The labels here aren't really button labels, but we use CONTEXT_BUTTON to
// match the style of the LabelButton text normally used in bookmarks bar. // match the style of the LabelButton text normally used in bookmarks bar.
constexpr int kTextContext = views::style::CONTEXT_BUTTON; constexpr int kBookmarkBarTextContext = views::style::CONTEXT_BUTTON;
// Horizontal padding, in pixels, between the link and label. // Horizontal padding, in pixels, between the link and label.
int GetViewPadding() { int GetViewPadding() {
...@@ -39,15 +39,17 @@ BookmarkBarInstructionsView::BookmarkBarInstructionsView( ...@@ -39,15 +39,17 @@ BookmarkBarInstructionsView::BookmarkBarInstructionsView(
instructions_(NULL), instructions_(NULL),
import_link_(NULL), import_link_(NULL),
updated_colors_(false) { updated_colors_(false) {
instructions_ = new views::Label( instructions_ =
l10n_util::GetStringUTF16(IDS_BOOKMARKS_NO_ITEMS), kTextContext); new views::Label(l10n_util::GetStringUTF16(IDS_BOOKMARKS_NO_ITEMS),
kBookmarkBarTextContext);
instructions_->SetAutoColorReadabilityEnabled(false); instructions_->SetAutoColorReadabilityEnabled(false);
instructions_->SetHorizontalAlignment(gfx::ALIGN_LEFT); instructions_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
AddChildView(instructions_); AddChildView(instructions_);
if (browser_defaults::kShowImportOnBookmarkBar) { if (browser_defaults::kShowImportOnBookmarkBar) {
import_link_ = new views::Link( import_link_ =
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_IMPORT_LINK), kTextContext); new views::Link(l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_IMPORT_LINK),
kBookmarkBarTextContext);
// We don't want the link to alter tab navigation. // We don't want the link to alter tab navigation.
import_link_->SetFocusBehavior(FocusBehavior::NEVER); import_link_->SetFocusBehavior(FocusBehavior::NEVER);
import_link_->set_listener(this); import_link_->set_listener(this);
......
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
namespace { namespace {
// The text context / style of the |PermissionSelectorRow| combobox and label. // The text context / style of the |PermissionSelectorRow| combobox and label.
constexpr int kTextContext = views::style::CONTEXT_LABEL; constexpr int kPermissionRowTextContext = views::style::CONTEXT_LABEL;
constexpr int kTextStyle = views::style::STYLE_PRIMARY; constexpr int kPermissionRowTextStyle = views::style::STYLE_PRIMARY;
// Calculates the amount of padding to add beneath a |PermissionSelectorRow| // Calculates the amount of padding to add beneath a |PermissionSelectorRow|
// depending on whether it has an accompanying permission decision reason. // depending on whether it has an accompanying permission decision reason.
...@@ -52,7 +52,8 @@ int CalculatePaddingBeneathPermissionRow(bool has_reason) { ...@@ -52,7 +52,8 @@ int CalculatePaddingBeneathPermissionRow(bool has_reason) {
// subtracting the line height, then dividing everything by two. Note it is // subtracting the line height, then dividing everything by two. Note it is
// assumed the combobox is the tallest part of the row. // assumed the combobox is the tallest part of the row.
return (list_item_padding * 2 + combobox_height - return (list_item_padding * 2 + combobox_height -
views::style::GetLineHeight(kTextContext, kTextStyle)) / views::style::GetLineHeight(kPermissionRowTextContext,
kPermissionRowTextStyle)) /
2; 2;
} }
...@@ -372,7 +373,8 @@ PermissionSelectorRow::~PermissionSelectorRow() { ...@@ -372,7 +373,8 @@ PermissionSelectorRow::~PermissionSelectorRow() {
// static // static
int PermissionSelectorRow::MinHeightForPermissionRow() { int PermissionSelectorRow::MinHeightForPermissionRow() {
return ChromeLayoutProvider::Get()->GetControlHeightForFont( return ChromeLayoutProvider::Get()->GetControlHeightForFont(
kTextContext, kTextStyle, views::Combobox::GetFontList()); kPermissionRowTextContext, kPermissionRowTextStyle,
views::Combobox::GetFontList());
} }
void PermissionSelectorRow::AddObserver( void PermissionSelectorRow::AddObserver(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment