OLD | NEW |
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_PANELS_PANEL_TITLEBAR_VIEW_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_TITLEBAR_VIEW_COCOA_H_ |
6 #define CHROME_BROWSER_UI_PANELS_PANEL_TITLEBAR_VIEW_COCOA_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_TITLEBAR_VIEW_COCOA_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #import "chrome/browser/ui/cocoa/tracking_area.h" | 10 #import "chrome/browser/ui/cocoa/tracking_area.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 - (void)setTitle:(NSString*)newTitle; | 60 - (void)setTitle:(NSString*)newTitle; |
61 - (void)setIcon:(NSView*)newIcon; | 61 - (void)setIcon:(NSView*)newIcon; |
62 | 62 |
63 - (NSView*)icon; | 63 - (NSView*)icon; |
64 | 64 |
65 // Should be called when size of the titlebar changes. | 65 // Should be called when size of the titlebar changes. |
66 - (void)updateCloseButtonLayout; | 66 - (void)updateCloseButtonLayout; |
67 - (void)updateIconAndTitleLayout; | 67 - (void)updateIconAndTitleLayout; |
68 | 68 |
69 // We need to update our look when the Chrome theme changes or window focus | 69 // Various events that we'll need to redraw our titlebar for. |
70 // changes. | 70 - (void)didChangeFrame:(NSNotification*)notification; |
71 - (void)didChangeTheme:(NSNotification*)notification; | 71 - (void)didChangeTheme:(NSNotification*)notification; |
72 - (void)didChangeMainWindow:(NSNotification*)notification; | 72 - (void)didChangeMainWindow:(NSNotification*)notification; |
73 | 73 |
74 // Helpers to control title drag operation, called from more then one place. | 74 // Helpers to control title drag operation, called from more then one place. |
75 // TODO(dimich): replace BOOL parameter that we have to explicitly specify at | 75 // TODO(dimich): replace BOOL parameter that we have to explicitly specify at |
76 // callsites with an enum defined in PanelManager. | 76 // callsites with an enum defined in PanelManager. |
77 - (void)startDrag; | 77 - (void)startDrag; |
78 - (void)endDrag:(BOOL)cancelled; | 78 - (void)endDrag:(BOOL)cancelled; |
79 - (void)dragWithDeltaX:(int)deltaX; | 79 - (void)dragWithDeltaX:(int)deltaX; |
80 | 80 |
81 // Update the visibility of settings button. | 81 // Update the visibility of settings button. |
82 - (void)updateSettingsButtonVisibility:(BOOL)mouseOverWindow; | 82 - (void)updateSettingsButtonVisibility:(BOOL)mouseOverWindow; |
83 - (void)checkMouseAndUpdateSettingsButtonVisibility; | 83 - (void)checkMouseAndUpdateSettingsButtonVisibility; |
84 | 84 |
85 // Draw Attention methods - change appearance of titlebar to attract user. | 85 // Draw Attention methods - change appearance of titlebar to attract user. |
86 - (void)drawAttention; | 86 - (void)drawAttention; |
87 - (void)stopDrawingAttention; | 87 - (void)stopDrawingAttention; |
88 - (BOOL)isDrawingAttention; | 88 - (BOOL)isDrawingAttention; |
89 @end // @interface PanelTitlebarView | 89 @end // @interface PanelTitlebarView |
90 | 90 |
91 // Methods which are either only for testing, or only public for testing. | 91 // Methods which are either only for testing, or only public for testing. |
92 @interface PanelTitlebarViewCocoa(TestingAPI) | 92 @interface PanelTitlebarViewCocoa(TestingAPI) |
93 | 93 |
94 - (PanelWindowControllerCocoa*)controller; | 94 - (PanelWindowControllerCocoa*)controller; |
95 | 95 |
| 96 - (NSTextField*)title; |
| 97 |
96 // Simulates click on a close button. Used to test panel closing. | 98 // Simulates click on a close button. Used to test panel closing. |
97 - (void)simulateCloseButtonClick; | 99 - (void)simulateCloseButtonClick; |
98 | 100 |
99 // NativePanelTesting support. | 101 // NativePanelTesting support. |
100 - (void)pressLeftMouseButtonTitlebar; | 102 - (void)pressLeftMouseButtonTitlebar; |
101 - (void)releaseLeftMouseButtonTitlebar; | 103 - (void)releaseLeftMouseButtonTitlebar; |
102 - (void)dragTitlebarDeltaX:(double)delta_x | 104 - (void)dragTitlebarDeltaX:(double)delta_x |
103 deltaY:(double)delta_y; | 105 deltaY:(double)delta_y; |
104 - (void)cancelDragTitlebar; | 106 - (void)cancelDragTitlebar; |
105 - (void)finishDragTitlebar; | 107 - (void)finishDragTitlebar; |
106 | 108 |
107 @end // @interface PanelTitlebarViewCocoa(TestingAPI) | 109 @end // @interface PanelTitlebarViewCocoa(TestingAPI) |
108 | 110 |
109 #endif // CHROME_BROWSER_UI_PANELS_PANEL_TITLEBAR_VIEW_COCOA_H_ | 111 #endif // CHROME_BROWSER_UI_PANELS_PANEL_TITLEBAR_VIEW_COCOA_H_ |
OLD | NEW |