blob: 7693e851d8d4d6b4c5f0a269ab00cabe5c57a998 [file] [log] [blame]
// Copyright 2018 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.
#import <Foundation/Foundation.h>
class ChromeBrowserState;
@protocol BookmarkHomeConsumer;
@class BookmarkHomeSharedState;
// BookmarkHomeMediator manages model interactions for the
// BookmarkHomeViewController.
@interface BookmarkHomeMediator : NSObject
@property(nonatomic, weak) id<BookmarkHomeConsumer> consumer;
- (instancetype)initWithSharedState:(BookmarkHomeSharedState*)sharedState
- (instancetype)init NS_UNAVAILABLE;
// Starts this mediator. Populates the table view model with current data and
// begins listening for backend model updates.
- (void)startMediating;
// Stops mediating and disconnects from backend models.
- (void)disconnect;
// Rebuilds the table view model data for the Bookmarks section. Deletes any
// existing data first.
- (void)computeBookmarkTableViewData;
// Rebuilds the table view model data for the bookmarks matching the given text.
// Deletes any existing data first. If no items found, an entry with
// |noResults' message is added to the table.
- (void)computeBookmarkTableViewDataMatching:(NSString*)searchText
// Updates promo cell based on its current visibility.
- (void)computePromoTableViewData;