OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ |
| 7 |
| 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" |
| 13 |
| 14 class BookmarkModel; |
| 15 class Profile; |
| 16 |
| 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(); |
| 25 |
| 26 // Returns the BookmarkModel that corresponds to this ChromeBookmarkClient. |
| 27 BookmarkModel* model() { return model_.get(); } |
| 28 |
| 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; |
| 43 |
| 44 // content::NotificationObserver: |
| 45 virtual void Observe(int type, |
| 46 const content::NotificationSource& source, |
| 47 const content::NotificationDetails& details) OVERRIDE; |
| 48 |
| 49 // KeyedService: |
| 50 virtual void Shutdown() OVERRIDE; |
| 51 |
| 52 private: |
| 53 Profile* profile_; |
| 54 |
| 55 content::NotificationRegistrar registrar_; |
| 56 |
| 57 scoped_ptr<BookmarkModel> model_; |
| 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClient); |
| 60 }; |
| 61 |
| 62 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ |
OLD | NEW |