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

Side by Side Diff: chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm

Issue 2668393003: Fix using theme colors for the download shelf's close button. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.h" 5 #import "chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.h"
6 6
7 #include "chrome/browser/themes/theme_properties.h" 7 #include "chrome/browser/themes/theme_properties.h"
8 #include "chrome/browser/themes/theme_service.h" 8 #include "chrome/browser/themes/theme_service.h"
9 #include "chrome/browser/ui/cocoa/hover_close_button.h"
9 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" 10 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
10 #import "chrome/browser/ui/cocoa/view_id_util.h" 11 #import "chrome/browser/ui/cocoa/view_id_util.h"
11 #import "ui/base/cocoa/nsview_additions.h" 12 #import "ui/base/cocoa/nsview_additions.h"
12 #include "ui/base/material_design/material_design_controller.h" 13 #include "ui/base/material_design/material_design_controller.h"
13 14
14 @implementation DownloadShelfView 15 @implementation DownloadShelfView
15 16
16 // For programmatic instantiations in unit tests. 17 // For programmatic instantiations in unit tests.
17 - (id)initWithFrame:(NSRect)frameRect { 18 - (id)initWithFrame:(NSRect)frameRect {
18 if ((self = [super initWithFrame:frameRect])) { 19 if ((self = [super initWithFrame:frameRect])) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 NSColor* highlightColor = themeProvider->GetNSColor(resourceName); 55 NSColor* highlightColor = themeProvider->GetNSColor(resourceName);
55 if (highlightColor) { 56 if (highlightColor) {
56 [highlightColor set]; 57 [highlightColor set];
57 NSRectFillUsingOperation(NSIntersectionRect(borderRect, dirtyRect), 58 NSRectFillUsingOperation(NSIntersectionRect(borderRect, dirtyRect),
58 NSCompositeSourceOver); 59 NSCompositeSourceOver);
59 } 60 }
60 } 61 }
61 } 62 }
62 } 63 }
63 64
65 - (void)viewWillDraw {
66 if (const ui::ThemeProvider* themeProvider = [[self window] themeProvider]) {
67 [closeButton_
68 setIconColor:themeProvider->GetColor(ThemeProperties::COLOR_TAB_TEXT)];
69 }
70 [super viewWillDraw];
71 }
72
64 // Mouse down events on the download shelf should not allow dragging the parent 73 // Mouse down events on the download shelf should not allow dragging the parent
65 // window around. 74 // window around.
66 - (BOOL)mouseDownCanMoveWindow { 75 - (BOOL)mouseDownCanMoveWindow {
67 return NO; 76 return NO;
68 } 77 }
69 78
70 - (ViewID)viewID { 79 - (ViewID)viewID {
71 return VIEW_ID_DOWNLOAD_SHELF; 80 return VIEW_ID_DOWNLOAD_SHELF;
72 } 81 }
73 82
74 - (BOOL)isOpaque { 83 - (BOOL)isOpaque {
75 return YES; 84 return YES;
76 } 85 }
77 86
78 @end 87 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698