1 // Copyright 2015 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.
5 #ifndef IOS_CHROME_BROWSER_BOOKMARKS_BOOKMARK_CLIENT_IMPL_H_
6 #define IOS_CHROME_BROWSER_BOOKMARKS_BOOKMARK_CLIENT_IMPL_H_
11 #include "base/deferred_sequenced_task_runner.h"
12 #include "base/macros.h"
13 #include "components/bookmarks/browser/bookmark_client.h"
24 class BookmarkPermanentNode
;
25 class ManagedBookmarkService
;
29 class ChromeBrowserState
;
32 class BookmarkClientImpl
: public bookmarks::BookmarkClient
{
35 ios::ChromeBrowserState
* browser_state
,
36 bookmarks::ManagedBookmarkService
* managed_bookmark_service
);
37 ~BookmarkClientImpl() override
;
39 void Init(bookmarks::BookmarkModel
* bookmark_model
);
42 void Shutdown() override
;
44 // bookmarks::BookmarkClient:
45 bool PreferTouchIcon() override
;
46 base::CancelableTaskTracker::TaskId
GetFaviconImageForPageURL(
48 favicon_base::IconType type
,
49 const favicon_base::FaviconImageCallback
& callback
,
50 base::CancelableTaskTracker
* tracker
) override
;
51 bool SupportsTypedCountForNodes() override
;
52 void GetTypedCountForNodes(
54 NodeTypedCountPairs
* node_typed_count_pairs
) override
;
55 bool IsPermanentNodeVisible(
56 const bookmarks::BookmarkPermanentNode
* node
) override
;
57 void RecordAction(const base::UserMetricsAction
& action
) override
;
58 bookmarks::LoadExtraCallback
GetLoadExtraNodesCallback() override
;
59 bool CanSetPermanentNodeTitle(
60 const bookmarks::BookmarkNode
* permanent_node
) override
;
61 bool CanSyncNode(const bookmarks::BookmarkNode
* node
) override
;
62 bool CanBeEditedByUser(const bookmarks::BookmarkNode
* node
) override
;
65 // Pointer to the associated ios::ChromeBrowserState. Must outlive
66 // BookmarkClientImpl.
67 ios::ChromeBrowserState
* browser_state_
;
69 // Pointer to the ManagedBookmarkService responsible for bookmark policy. May
70 // be null during testing.
71 bookmarks::ManagedBookmarkService
* managed_bookmark_service_
;
73 DISALLOW_COPY_AND_ASSIGN(BookmarkClientImpl
);
76 #endif // IOS_CHROME_BROWSER_BOOKMARKS_BOOKMARK_CLIENT_IMPL_H_