1 // Copyright 2014 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 CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_
6 #define CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_
8 #include "base/compiler_specific.h"
9 #include "components/bookmarks/core/browser/bookmark_client.h"
10 #include "components/keyed_service/core/keyed_service.h"
11 #include "content/public/browser/notification_observer.h"
12 #include "content/public/browser/notification_registrar.h"
17 class ChromeBookmarkClient
: public BookmarkClient
,
18 public content::NotificationObserver
,
21 // |index_urls| says whether URLs should be stored in the BookmarkIndex
22 // in addition to bookmark titles.
23 ChromeBookmarkClient(Profile
* profile
, bool index_urls
);
24 virtual ~ChromeBookmarkClient();
26 // Returns the BookmarkModel that corresponds to this ChromeBookmarkClient.
27 BookmarkModel
* model() { return model_
.get(); }
30 virtual base::CancelableTaskTracker::TaskId
GetFaviconImageForURL(
33 int desired_size_in_dip
,
34 const FaviconImageCallback
& callback
,
35 base::CancelableTaskTracker
* tracker
) OVERRIDE
;
36 virtual bool SupportsTypedCountForNodes() OVERRIDE
;
37 virtual void GetTypedCountForNodes(
39 NodeTypedCountPairs
* node_typed_count_pairs
) OVERRIDE
;
40 virtual void RecordAction(const base::UserMetricsAction
& action
) OVERRIDE
;
41 virtual void NotifyHistoryAboutRemovedBookmarks(
42 const std::set
<GURL
>& removed_bookmarks_urls
) OVERRIDE
;
44 // content::NotificationObserver:
45 virtual void Observe(int type
,
46 const content::NotificationSource
& source
,
47 const content::NotificationDetails
& details
) OVERRIDE
;
50 virtual void Shutdown() OVERRIDE
;
55 content::NotificationRegistrar registrar_
;
57 scoped_ptr
<BookmarkModel
> model_
;
59 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClient
);
62 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_