| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_UI_COCOA_PANELS_PANEL_TITLEBAR_VIEW_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PANELS_PANEL_TITLEBAR_VIEW_COCOA_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_PANELS_PANEL_TITLEBAR_VIEW_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_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/panels/mouse_drag_controller.h" | 10 #import "chrome/browser/ui/cocoa/panels/mouse_drag_controller.h" |
| 11 #import "chrome/browser/ui/cocoa/tracking_area.h" | 11 #import "ui/base/cocoa/tracking_area.h" |
| 12 | 12 |
| 13 @class CrTrackingArea; | |
| 14 @class HoverImageButton; | 13 @class HoverImageButton; |
| 15 @class MouseDragController; | 14 @class MouseDragController; |
| 16 @class PanelWindowControllerCocoa; | 15 @class PanelWindowControllerCocoa; |
| 17 | 16 |
| 18 // A class that works as a custom titlebar for Panels. It is placed on top of | 17 // A class that works as a custom titlebar for Panels. It is placed on top of |
| 19 // the regular Cocoa titlebar. It's the place for the close button, page | 18 // the regular Cocoa titlebar. It's the place for the close button, page |
| 20 // favicon, title label and a button to minimize/restore the panel. | 19 // favicon, title label and a button to minimize/restore the panel. |
| 21 // It also facilitates dragging and minimization of the panels, and changes | 20 // It also facilitates dragging and minimization of the panels, and changes |
| 22 // color as 'new activity' indicator. | 21 // color as 'new activity' indicator. |
| 23 // One way to have custom titlebar would be to use NSBorderlessWindow, | 22 // One way to have custom titlebar would be to use NSBorderlessWindow, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 51 IBOutlet NSView* icon_; | 50 IBOutlet NSView* icon_; |
| 52 IBOutlet NSTextField* title_; | 51 IBOutlet NSTextField* title_; |
| 53 IBOutlet HoverImageButton* minimizeButton_; | 52 IBOutlet HoverImageButton* minimizeButton_; |
| 54 IBOutlet HoverImageButton* restoreButton_; | 53 IBOutlet HoverImageButton* restoreButton_; |
| 55 IBOutlet HoverImageButton* customCloseButton_; | 54 IBOutlet HoverImageButton* customCloseButton_; |
| 56 // Transparent view on top of entire titlebar. It catches mouse events to | 55 // Transparent view on top of entire titlebar. It catches mouse events to |
| 57 // prevent window activation by the system on mouseDown. | 56 // prevent window activation by the system on mouseDown. |
| 58 IBOutlet NSView* overlay_; | 57 IBOutlet NSView* overlay_; |
| 59 NSButton* closeButton_; // Created explicitly, not from NIB. Weak, destroyed | 58 NSButton* closeButton_; // Created explicitly, not from NIB. Weak, destroyed |
| 60 // when view is destroyed, as a subview. | 59 // when view is destroyed, as a subview. |
| 61 ScopedCrTrackingArea closeButtonTrackingArea_; | 60 ui::ScopedCrTrackingArea closeButtonTrackingArea_; |
| 62 BOOL isDrawingAttention_; | 61 BOOL isDrawingAttention_; |
| 63 | 62 |
| 64 // "Glint" animation is used in "Draw Attention" mode. | 63 // "Glint" animation is used in "Draw Attention" mode. |
| 65 scoped_nsobject<RepaintAnimation> glintAnimation_; | 64 scoped_nsobject<RepaintAnimation> glintAnimation_; |
| 66 scoped_nsobject<NSTimer> glintAnimationTimer_; | 65 scoped_nsobject<NSTimer> glintAnimationTimer_; |
| 67 int glintCounter_; | 66 int glintCounter_; |
| 68 | 67 |
| 69 // Drag support. | 68 // Drag support. |
| 70 scoped_nsobject<MouseDragController> dragController_; | 69 scoped_nsobject<MouseDragController> dragController_; |
| 71 } | 70 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 - (void)pressLeftMouseButtonTitlebar:(NSPoint)mouseLocation | 122 - (void)pressLeftMouseButtonTitlebar:(NSPoint)mouseLocation |
| 124 modifiers:(int)modifierFlags; | 123 modifiers:(int)modifierFlags; |
| 125 - (void)releaseLeftMouseButtonTitlebar:(int)modifierFlags; | 124 - (void)releaseLeftMouseButtonTitlebar:(int)modifierFlags; |
| 126 - (void)dragTitlebar:(NSPoint)mouseLocation; | 125 - (void)dragTitlebar:(NSPoint)mouseLocation; |
| 127 - (void)cancelDragTitlebar; | 126 - (void)cancelDragTitlebar; |
| 128 - (void)finishDragTitlebar; | 127 - (void)finishDragTitlebar; |
| 129 | 128 |
| 130 @end // @interface PanelTitlebarViewCocoa(TestingAPI) | 129 @end // @interface PanelTitlebarViewCocoa(TestingAPI) |
| 131 | 130 |
| 132 #endif // CHROME_BROWSER_UI_COCOA_PANELS_PANEL_TITLEBAR_VIEW_COCOA_H_ | 131 #endif // CHROME_BROWSER_UI_COCOA_PANELS_PANEL_TITLEBAR_VIEW_COCOA_H_ |
| OLD | NEW |