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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 2682803003: Gtk3: Add themable location bar border color (Closed)
Patch Set: add location_bar_border_color local 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 17dfec364cb218ce8b138dc11ea58e2a3410e41c..a37de8a5213311b147b0baffddc3d5117ff634b2 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/themes/theme_properties.h"
+#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/translate/chrome_translate_client.h"
#include "chrome/browser/translate/translate_service.h"
#include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h"
@@ -102,13 +103,6 @@
using content::WebContents;
using views::View;
-namespace {
-
-// The border color, drawn on top of the toolbar.
-const SkColor kBorderColor = SkColorSetA(SK_ColorBLACK, 0x4D);
-
-} // namespace
-
// LocationBarView -----------------------------------------------------------
@@ -159,13 +153,6 @@ LocationBarView::~LocationBarView() {
////////////////////////////////////////////////////////////////////////////////
// LocationBarView, public:
-// static
-SkColor LocationBarView::GetOpaqueBorderColor(bool incognito) {
- return color_utils::GetResultingPaintColor(
- kBorderColor, ThemeProperties::GetDefaultColor(
- ThemeProperties::COLOR_TOOLBAR, incognito));
-}
-
void LocationBarView::Init() {
// We need to be in a Widget, otherwise GetNativeTheme() may change and we're
// not prepared for that.
@@ -304,6 +291,12 @@ SkColor LocationBarView::GetColor(
return gfx::kPlaceholderColor;
}
+SkColor LocationBarView::GetOpaqueBorderColor(bool incognito) {
Peter Kasting 2017/02/11 10:18:46 Should be const
+ return color_utils::GetResultingPaintColor(
+ GetBorderColor(), ThemeProperties::GetDefaultColor(
+ ThemeProperties::COLOR_TOOLBAR, incognito));
+}
+
SkColor LocationBarView::GetSecureTextColor(
security_state::SecurityLevel security_level) const {
if (security_level == security_state::SECURE_WITH_POLICY_INSTALLED_CERT) {
@@ -614,7 +607,7 @@ void LocationBarView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
// This border color will be blended on top of the toolbar (which may use an
// image in the case of themes).
set_background(
- new BackgroundWith1PxBorder(GetColor(BACKGROUND), kBorderColor));
+ new BackgroundWith1PxBorder(GetColor(BACKGROUND), GetBorderColor()));
}
SchedulePaint();
}
@@ -669,6 +662,11 @@ int LocationBarView::IncrementalMinimumWidth(views::View* view) const {
: 0;
}
+SkColor LocationBarView::GetBorderColor() {
Peter Kasting 2017/02/11 10:18:46 Should be const
+ return GetThemeProvider()->GetColor(
+ ThemeProperties::COLOR_LOCATION_BAR_BORDER);
+}
+
int LocationBarView::GetHorizontalEdgeThickness() const {
return is_popup_mode_
? 0
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698