| Index: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h
|
| diff --git a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c82cab09e763d50168a7e7ac6d6007780b94fd0f
|
| --- /dev/null
|
| +++ b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h
|
| @@ -0,0 +1,78 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_VIEW_H_
|
| +#define IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_VIEW_H_
|
| +
|
| +#import <UIKit/UIKit.h>
|
| +
|
| +namespace ios_internal {
|
| +// Describes the current Index of an action in the OverScrollActionsView.
|
| +enum class OverscrollAction {
|
| + NONE, // No action
|
| + NEW_TAB, // New tab action
|
| + REFRESH, // Refresh action
|
| + CLOSE_TAB, // Close tab action
|
| +};
|
| +
|
| +// Describes the style of the overscroll action UI.
|
| +enum class OverscrollStyle {
|
| + NTP_NON_INCOGNITO, // UI to fit the NTP in non incognito.
|
| + NTP_INCOGNITO, // UI to fit the NTP in incognito.
|
| + REGULAR_PAGE_NON_INCOGNITO, // UI to fit regular pages in non incognito.
|
| + REGULAR_PAGE_INCOGNITO // UI to fit regular pages in incognito.
|
| +};
|
| +
|
| +} // namespace ios_internal
|
| +
|
| +@class OverscrollActionsView;
|
| +
|
| +@protocol OverscrollActionsViewDelegate
|
| +
|
| +- (void)overscrollActionsViewDidTapTriggerAction:
|
| + (OverscrollActionsView*)overscrollActionsView;
|
| +
|
| +@end
|
| +
|
| +// This view displays the actions of the OverscrollActionsController.
|
| +// How actions are displayed depends on the vertical and horizontal offsets.
|
| +@interface OverscrollActionsView : UIView
|
| +
|
| +// The currently selected action.
|
| +@property(nonatomic, assign, readonly)
|
| + ios_internal::OverscrollAction selectedAction;
|
| +// The view displayed has the background of the overscroll actions view.
|
| +@property(nonatomic, retain, readonly) UIView* backgroundView;
|
| +// Whether cropping is set on the selection circle (true by default).
|
| +@property(nonatomic, assign) BOOL selectionCroppingEnabled;
|
| +
|
| +@property(nonatomic, assign) id<OverscrollActionsViewDelegate> delegate;
|
| +
|
| +// Add a snapshot view on top of the background image view. The previous
|
| +// snapshot view if any will be removed.
|
| +- (void)addSnapshotView:(UIView*)view;
|
| +
|
| +// Called to indicate that a new pull gesture has started.
|
| +- (void)pullStarted;
|
| +
|
| +// Vertical offset [0, yOffset].
|
| +// This offset is set to the top inset of the scrollView managed by the
|
| +// OverscrollActionsController.
|
| +- (void)updateWithVerticalOffset:(CGFloat)offset;
|
| +
|
| +// Horizontal offset [-1,1].
|
| +// This offset is set by the OverscrollActionsController and is used to display
|
| +// the action selection circle.
|
| +- (void)updateWithHorizontalOffset:(CGFloat)offset;
|
| +
|
| +// This starts an "ink response" like animation typically triggered when an
|
| +// action has been selected.
|
| +- (void)displayActionAnimation;
|
| +
|
| +// Sets the style of the overscroll action UI.
|
| +- (void)setStyle:(ios_internal::OverscrollStyle)style;
|
| +
|
| +@end
|
| +
|
| +#endif // IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_VIEW_H_
|
|
|