| Index: ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.h
|
| diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c37ad7bd77dce161ca6a87d9fd34d1c80d80c9b5
|
| --- /dev/null
|
| +++ b/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.h
|
| @@ -0,0 +1,64 @@
|
| +// 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_TAB_SWITCHER_TAB_SWITCHER_HEADER_VIEW_H_
|
| +#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_HEADER_VIEW_H_
|
| +
|
| +#import <UIKit/UIKit.h>
|
| +
|
| +#include "base/ios/block_types.h"
|
| +
|
| +@class SessionCellData;
|
| +@class TabSwitcherHeaderView;
|
| +
|
| +@protocol TabSwitcherHeaderViewDelegate<NSObject>
|
| +
|
| +- (void)tabSwitcherHeaderViewDismiss:(TabSwitcherHeaderView*)view;
|
| +- (void)tabSwitcherHeaderViewDidSelectSessionAtIndex:(NSInteger)index;
|
| +// Called to get the currently selected panel index. Returns NSNotFound when no
|
| +// panel is selected.
|
| +- (NSInteger)tabSwitcherHeaderViewSelectedPanelIndex;
|
| +
|
| +@end
|
| +
|
| +@protocol TabSwitcherHeaderViewDataSource<NSObject>
|
| +
|
| +- (NSInteger)tabSwitcherHeaderViewSessionCount;
|
| +- (SessionCellData*)sessionCellDataAtIndex:(NSUInteger)index;
|
| +
|
| +@end
|
| +
|
| +@interface TabSwitcherHeaderView : UIView
|
| +
|
| +@property(nonatomic, assign) id<TabSwitcherHeaderViewDelegate> delegate;
|
| +@property(nonatomic, assign) id<TabSwitcherHeaderViewDataSource> dataSource;
|
| +@property(nonatomic, readonly) UIView* dismissButton;
|
| +
|
| +// Selects the item at the specified index.
|
| +// The delegate is not called.
|
| +- (void)selectItemAtIndex:(NSInteger)index;
|
| +
|
| +// Reload the collection view.
|
| +- (void)reloadData;
|
| +
|
| +// Performs an update on the header view using the passed block.
|
| +- (void)performUpdate:(void (^)(TabSwitcherHeaderView* headerView))updateBlock;
|
| +
|
| +// Performs an update on the header view using the passed block, the completion
|
| +// handler block is called at the end of the update animations.
|
| +- (void)performUpdate:(void (^)(TabSwitcherHeaderView* headerView))updateBlock
|
| + completion:(ProceduralBlock)completion;
|
| +
|
| +// Updates methods can only be called inside an update block passed to the
|
| +// - (void)performUpdate: method.
|
| +// Update methods takes arrays of NSNumbers.
|
| +- (void)insertSessionsAtIndexes:(NSArray*)indexes;
|
| +- (void)removeSessionsAtIndexes:(NSArray*)indexes;
|
| +
|
| +// Returns the accessibility title of the panel at index |index|.
|
| +- (NSString*)panelTitleAtIndex:(NSInteger)index;
|
| +
|
| +@end
|
| +
|
| +#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_HEADER_VIEW_H_
|
|
|