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 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_UI_COCOA_OVERLAY_PANEL_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_COCOA_OVERLAY_PANEL_CONTROLLER_H_ 7 8 #import <Cocoa/Cocoa.h> 9 10 #include "base/mac/scoped_nsobject.h" 11 12 @class HistoryOverlayView; 13 14 enum HistoryOverlayMode { 15 kHistoryOverlayModeBack, 16 kHistoryOverlayModeForward 17 }; 18 19 // The HistoryOverlayController manages a view that is inserted atop the web 20 // contents to provide visual feedback when the user is performing history 21 // navigation gestures. 22 @interface HistoryOverlayController : NSViewController { 23 @private 24 HistoryOverlayMode mode_; 25 // Strongly typed reference of self.view. 26 base::scoped_nsobject<HistoryOverlayView> contentView_; 27 // The view above which self.view is inserted as a subview. 28 base::scoped_nsobject<NSView> parent_; 29 } 30 31 // Designated initializer. 32 - (id)initForMode:(HistoryOverlayMode)mode; 33 34 // Shows the shield above |view|. 35 - (void)showPanelForView:(NSView*)view; 36 37 // Updates the appearance of the overlay based on track gesture progress. 38 // gestureAmount must be between 0 and 1. 39 // 0 indicates no progress. 1 indicates maximum progress. 40 // Finished indicates whether the gesture has reached maximum progress. 41 - (void)setProgress:(CGFloat)gestureAmount finished:(BOOL)finished; 42 43 // Fades the shield out and removes it from the view hierarchy. 44 - (void)dismiss; 45 46 @end 47 48 #endif // CHROME_BROWSER_UI_COCOA_OVERLAY_PANEL_CONTROLLER_H_ 49