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

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

Issue 2618403002: Reland crrev.com/8283cad74e0cad4840d1f with fix for static initializers. (Closed)
Patch Set: re-up 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 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 "base/mac/scoped_nsobject.h" 10 #import "base/mac/scoped_nsobject.h"
11 #import "chrome/browser/ui/cocoa/themed_window.h" 11 #import "chrome/browser/ui/cocoa/themed_window.h"
12 #import "ui/gfx/color_utils.h" 12 #import "ui/gfx/color_utils.h"
13 #include "ui/gfx/vector_icons_public.h" 13
14 namespace gfx {
15 struct VectorIcon;
16 }
14 17
15 enum class ToolbarButtonImageBackgroundStyle { 18 enum class ToolbarButtonImageBackgroundStyle {
16 DEFAULT, 19 DEFAULT,
17 HOVER, 20 HOVER,
18 HOVER_THEMED, 21 HOVER_THEMED,
19 PRESSED, 22 PRESSED,
20 PRESSED_THEMED, 23 PRESSED_THEMED,
21 }; 24 };
22 25
23 // NSButton subclass which handles middle mouse clicking. 26 // NSButton subclass which handles middle mouse clicking.
24 @interface ToolbarButton : NSButton<ThemedWindowDrawing> { 27 @interface ToolbarButton : NSButton<ThemedWindowDrawing> {
25 @protected 28 @protected
26 // The toolbar button's image, as assigned by setImage:. 29 // The toolbar button's image, as assigned by setImage:.
27 base::scoped_nsobject<NSImage> image_; 30 base::scoped_nsobject<NSImage> image_;
28 31
29 // YES when middle mouse clicks should be handled. 32 // YES when middle mouse clicks should be handled.
30 BOOL handleMiddleClick_; 33 BOOL handleMiddleClick_;
31 } 34 }
32 35
33 // Return the size of toolbar buttons. 36 // Return the size of toolbar buttons.
34 + (NSSize)toolbarButtonSize; 37 + (NSSize)toolbarButtonSize;
35 // Whether or not to handle the mouse middle click events. 38 // Whether or not to handle the mouse middle click events.
36 @property(assign, nonatomic) BOOL handleMiddleClick; 39 @property(assign, nonatomic) BOOL handleMiddleClick;
37 // Override point for subclasses to return their vector icon id. 40 // Override point for subclasses to return their vector icon.
38 - (gfx::VectorIconId)vectorIconId; 41 - (const gfx::VectorIcon*)vectorIcon;
39 // Override point for subclasses to return their vector icon color. 42 // Override point for subclasses to return their vector icon color.
40 - (SkColor)vectorIconColor:(BOOL)themeIsDark; 43 - (SkColor)vectorIconColor:(BOOL)themeIsDark;
41 // When in Material Design mode, sets the images for each of the ToolbarButton's 44 // When in Material Design mode, sets the images for each of the ToolbarButton's
42 // states from the specified image. 45 // states from the specified image.
43 - (void)setImage:(NSImage*)anImage; 46 - (void)setImage:(NSImage*)anImage;
44 // Resets the images for each of the ToolbarButton's states from its vector icon 47 // Resets the images for each of the ToolbarButton's states from its vector icon
45 // id or its main image. Should only be called when in Material Design mode. 48 // id or its main image. Should only be called when in Material Design mode.
46 - (void)resetButtonStateImages; 49 - (void)resetButtonStateImages;
47 @end 50 @end
48 51
49 @interface ToolbarButton (ExposedForTesting) 52 @interface ToolbarButton (ExposedForTesting)
50 - (BOOL)shouldHandleEvent:(NSEvent*)theEvent; 53 - (BOOL)shouldHandleEvent:(NSEvent*)theEvent;
51 @end 54 @end
52 55
53 #endif // CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_BUTTON_COCOA_H_ 56 #endif // CHROME_BROWSER_UI_COCOA_TOOLBAR_TOOLBAR_BUTTON_COCOA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698