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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc

Issue 2357353003: Remove pre-MD code from bookmark bar (Views). (Closed)
Patch Set: null in comments Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc
index 71884cfad0e8799e8ca553e076ca62caa3259584..678f900f96451078b0a8c806d0254dd076a95a04 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc
@@ -13,7 +13,6 @@
#include "chrome/grit/generated_resources.h"
#include "ui/accessibility/ax_view_state.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/theme_provider.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/controls/label.h"
@@ -23,14 +22,9 @@ namespace {
// Horizontal padding, in pixels, between the link and label.
int GetViewPadding() {
- if (ui::MaterialDesignController::IsModeMaterial()) {
- static int space_width =
- views::Label(base::ASCIIToUTF16(" ")).GetPreferredSize().width();
- return space_width;
- }
-
- // Pre-MD is hard-coded to 6px.
- return 6;
+ static int space_width =
+ views::Label(base::ASCIIToUTF16(" ")).GetPreferredSize().width();
+ return space_width;
}
} // namespace
@@ -130,19 +124,15 @@ void BookmarkBarInstructionsView::UpdateColors() {
if (!import_link_)
return;
- if (!ui::MaterialDesignController::IsModeMaterial()) {
- import_link_->SetEnabledColor(text_color);
- } else {
- // For MD, use the default link color if it provides enough contrast. If
- // contrast is too low, fall back to the bookmark text color and use an
- // underline to make it obvious it's a link. The default color readability
- // code (which only adjusts luminance) doesn't work well in this case.
- SkColor bg = theme_provider->GetColor(ThemeProperties::COLOR_TOOLBAR);
- SkColor link_color =
- GetNativeTheme()->GetSystemColor(ui::NativeTheme::kColorId_LinkEnabled);
- bool link_has_contrast = color_utils::GetContrastRatio(link_color, bg) >=
- color_utils::kMinimumReadableContrastRatio;
- import_link_->SetUnderline(!link_has_contrast);
- import_link_->SetEnabledColor(link_has_contrast ? link_color : text_color);
- }
+ // Use the default link color if it provides enough contrast. If
+ // contrast is too low, fall back to the bookmark text color and use an
+ // underline to make it obvious it's a link. The default color readability
+ // code (which only adjusts luminance) doesn't work well in this case.
+ SkColor bg = theme_provider->GetColor(ThemeProperties::COLOR_TOOLBAR);
+ SkColor link_color =
+ GetNativeTheme()->GetSystemColor(ui::NativeTheme::kColorId_LinkEnabled);
+ bool link_has_contrast = color_utils::GetContrastRatio(link_color, bg) >=
+ color_utils::kMinimumReadableContrastRatio;
+ import_link_->SetUnderline(!link_has_contrast);
+ import_link_->SetEnabledColor(link_has_contrast ? link_color : text_color);
}
« no previous file with comments | « no previous file | chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698