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

Side by Side Diff: chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h

Issue 1770573002: Update extension buttons to Material Design (Mac). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@md_toolbar
Patch Set: Code clean-up. Created 4 years, 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_BUTTON_COCOA_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_BUTTON_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_BUTTON_COCOA_H_ 6 #define CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_BUTTON_COCOA_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #import "chrome/browser/ui/cocoa/themed_window.h" 10 #import "chrome/browser/ui/cocoa/themed_window.h"
11 #import "ui/gfx/color_utils.h" 11 #import "ui/gfx/color_utils.h"
12 #include "ui/gfx/vector_icons_public.h" 12 #include "ui/gfx/vector_icons_public.h"
13 13
14 enum class ToolbarButtonImageBackgroundStyle { 14 enum class ToolbarButtonImageBackgroundStyle {
15 HOVER, 15 HOVER,
16 HOVER_THEMED, 16 HOVER_THEMED,
17 PRESSED, 17 PRESSED,
18 PRESSED_THEMED, 18 PRESSED_THEMED,
19 }; 19 };
20 20
21 // NSButton subclass which handles middle mouse clicking. 21 // NSButton subclass which handles middle mouse clicking.
22 @interface ToolbarButton : NSButton<ThemedWindowDrawing> { 22 @interface ToolbarButton : NSButton<ThemedWindowDrawing> {
23 @protected 23 @protected
24 // YES when middle mouse clicks should be handled. 24 // YES when middle mouse clicks should be handled.
25 BOOL handleMiddleClick_; 25 BOOL handleMiddleClick_;
26 } 26 }
27 27
28 // Return the size of toolbar buttons.
29 + (NSSize)toolbarButtonSize;
28 // Whether or not to handle the mouse middle click events. 30 // Whether or not to handle the mouse middle click events.
29 @property(assign, nonatomic) BOOL handleMiddleClick; 31 @property(assign, nonatomic) BOOL handleMiddleClick;
30 // Override point for subclasses to return their icon color. 32 // Override point for subclasses to return their vector icon id.
31 - (SkColor)iconColor:(BOOL)themeIsDark; 33 - (gfx::VectorIconId)vectorIconId;
32 // Sets images for each of the ToolbarButton's states from the specified 34 // Override point for subclasses to return their vector icon color.
33 // vector icon. 35 - (SkColor)vectorIconColor:(BOOL)themeIsDark;
34 - (void)setImagesFromIconId:(gfx::VectorIconId)iconId; 36 // When in Material Design mode, sets the images for each of the ToolbarButton's
35 // Override point for subclasses to set the button's icons. 37 // states from the specified image.
36 - (void)resetIcons; 38 - (void)setImage:(NSImage*)anImage;
39 // Resets the images for each of the ToolbarButton's states from its vector icon
40 // id or its main image. Should only be called when in Material Design mode.
41 - (void)resetButtonStateImages;
37 @end 42 @end
38 43
39 @interface ToolbarButton (ExposedForTesting) 44 @interface ToolbarButton (ExposedForTesting)
40 - (BOOL)shouldHandleEvent:(NSEvent*)theEvent; 45 - (BOOL)shouldHandleEvent:(NSEvent*)theEvent;
41 @end 46 @end
42 47
43 #endif // CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_BUTTON_COCOA_H_ 48 #endif // CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_BUTTON_COCOA_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/reload_button_cocoa.mm ('k') | chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698