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

Unified Diff: ui/views/button_drag_utils.cc

Issue 1633793003: [MD] fix bookmark bar/URL bar drag image color for OTR mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | ui/views/drag_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/button_drag_utils.cc
diff --git a/ui/views/button_drag_utils.cc b/ui/views/button_drag_utils.cc
index 3fb5d12ed61b619b3e246cb0727fea3642b1c87c..60bd6e5abca8dca888391ffd2c8efd382376f9c7 100644
--- a/ui/views/button_drag_utils.cc
+++ b/ui/views/button_drag_utils.cc
@@ -14,7 +14,10 @@
#include "ui/gfx/geometry/vector2d.h"
#include "ui/gfx/image/image.h"
#include "ui/resources/grit/ui_resources.h"
+#include "ui/views/background.h"
+#include "ui/views/border.h"
#include "ui/views/controls/button/label_button.h"
+#include "ui/views/controls/button/label_button_border.h"
#include "ui/views/drag_utils.h"
#include "ui/views/resources/grit/views_resources.h"
#include "ui/views/widget/widget.h"
@@ -49,13 +52,17 @@ void SetDragImage(const GURL& url,
button.SetTextSubpixelRenderingEnabled(false);
const ui::NativeTheme* theme = widget->GetNativeTheme();
button.SetTextColor(views::Button::STATE_NORMAL,
- theme->GetSystemColor(ui::NativeTheme::kColorId_LabelEnabledColor));
- gfx::ShadowValues shadows(
- 10,
- gfx::ShadowValue(gfx::Vector2d(0, 0), 1.0f,
- theme->GetSystemColor(
- ui::NativeTheme::kColorId_LabelBackgroundColor)));
- button.SetTextShadows(shadows);
+ theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor));
+
+ SkColor bg_color = theme->GetSystemColor(
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground);
+ if (widget->IsTranslucentWindowOpacitySupported()) {
+ button.SetTextShadows(gfx::ShadowValues(
+ 10, gfx::ShadowValue(gfx::Vector2d(0, 0), 1.0f, bg_color)));
+ } else {
+ button.set_background(views::Background::CreateSolidBackground(bg_color));
+ button.SetBorder(button.CreateDefaultBorder());
+ }
button.SetMaxSize(gfx::Size(kLinkDragImageMaxWidth, 0));
if (icon.isNull()) {
button.SetImage(views::Button::STATE_NORMAL,
« no previous file with comments | « no previous file | ui/views/drag_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698