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

Unified Diff: chrome/browser/ui/cocoa/hover_close_button.mm

Issue 2668393003: Fix using theme colors for the download shelf's close button. (Closed)
Patch Set: Created 3 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
Index: chrome/browser/ui/cocoa/hover_close_button.mm
diff --git a/chrome/browser/ui/cocoa/hover_close_button.mm b/chrome/browser/ui/cocoa/hover_close_button.mm
index a5e59d57848e26c549d5a57d86894c250f902403..8b09fded38215fa1caab969747e4016199604645 100644
--- a/chrome/browser/ui/cocoa/hover_close_button.mm
+++ b/chrome/browser/ui/cocoa/hover_close_button.mm
@@ -7,13 +7,10 @@
#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/app/vector_icons/vector_icons.h"
-#include "chrome/browser/themes/theme_properties.h"
-#include "chrome/browser/themes/theme_service.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_view.h"
#include "chrome/grit/generated_resources.h"
-#include "chrome/grit/theme_resources.h"
#include "components/strings/grit/components_strings.h"
#import "third_party/google_toolbox_for_mac/src/AppKit/GTMKeyValueAnimation.h"
#include "ui/base/cocoa/animation_utils.h"
@@ -54,6 +51,8 @@ NSString* const kFadeOutValueKeyPath = @"fadeOutValue";
@implementation HoverCloseButton
+@synthesize iconColor = iconColor_;
+
+ (void)initialize {
// Grab some strings that are used by all close buttons.
if (!gBasicAccessibilityTitle) {
@@ -155,20 +154,14 @@ NSString* const kFadeOutValueKeyPath = @"fadeOutValue";
[self setNeedsDisplay];
}
-- (TabView *)tabView {
- return base::mac::ObjCCast<TabView>([self superview]);
-}
-
- (NSImage*)imageForHoverState:(HoverState)hoverState {
const gfx::VectorIcon* vectorIcon = nullptr;
SkColor vectorIconColor = gfx::kPlaceholderColor;
- TabView* tabView = [self tabView];
switch (hoverState) {
case kHoverStateNone:
vectorIcon = &kTabCloseNormalIcon;
- vectorIconColor =
- tabView ? [tabView iconColor] : tabs::kDefaultTabTextColor;
+ vectorIconColor = iconColor_;
break;
case kHoverStateMouseOver:
// For mouse over, the icon color is the fill color of the circle.
@@ -217,8 +210,8 @@ NSString* const kFadeOutValueKeyPath = @"fadeOutValue";
// tooltip contents immediately before showing it.
[self addToolTipRect:[self bounds] owner:self userData:NULL];
- // Initialize previousState.
previousState_ = kHoverStateNone;
+ iconColor_ = SkColorSetARGB(0xA0, 0x00, 0x00, 0x00);
spqchan 2017/02/02 17:36:44 nit: Hardcoded values should go into the namespace
Sidney San Martín 2017/02/02 18:58:14 Done.
}
// Called each time a tooltip is about to be shown.
@@ -251,6 +244,13 @@ NSString* const kFadeOutValueKeyPath = @"fadeOutValue";
[super setAccessibilityTitle:extendedTitle];
}
+- (void)setIconColor:(SkColor)iconColor {
+ if (iconColor != iconColor_) {
+ iconColor_ = iconColor;
+ [self setNeedsDisplay:YES];
+ }
+}
+
@end
@implementation WebUIHoverCloseButton

Powered by Google App Engine
This is Rietveld 408576698