[safe-browsing] Database full hash matches like prefix match.
[chromium-blink-merge.git] / chrome / browser / bookmarks / chrome_bookmark_client.h
blobac159ac2a4d4e961edcedbc5b8e580d9eac263a6
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"
14 class BookmarkModel;
15 class Profile;
17 class ChromeBookmarkClient : public BookmarkClient,
18 public content::NotificationObserver,
19 public KeyedService {
20 public:
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(); }
29 // BookmarkClient:
30 virtual base::CancelableTaskTracker::TaskId GetFaviconImageForURL(
31 const GURL& page_url,
32 int icon_types,
33 int desired_size_in_dip,
34 const FaviconImageCallback& callback,
35 base::CancelableTaskTracker* tracker) OVERRIDE;
36 virtual bool SupportsTypedCountForNodes() OVERRIDE;
37 virtual void GetTypedCountForNodes(
38 const NodeSet& nodes,
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;
49 // KeyedService:
50 virtual void Shutdown() OVERRIDE;
52 private:
53 Profile* profile_;
55 content::NotificationRegistrar registrar_;
57 scoped_ptr<BookmarkModel> model_;
59 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClient);
62 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_