Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
|
tfarina
2014/06/04 16:02:57
can you include macros.h instead?
sdefresne
2014/06/04 16:08:48
Done.
| |
| 9 #include "components/bookmarks/browser/base_bookmark_model_observer.h" | 9 #include "components/bookmarks/browser/base_bookmark_model_observer.h" |
| 10 #include "components/bookmarks/browser/bookmark_client.h" | 10 #include "components/bookmarks/browser/bookmark_client.h" |
| 11 #include "components/keyed_service/core/keyed_service.h" | 11 #include "components/keyed_service/core/keyed_service.h" |
|
tfarina
2014/06/04 16:02:57
can you remove this now?
sdefresne
2014/06/04 16:08:48
Done.
| |
| 12 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
| 14 | 14 |
| 15 class BookmarkModel; | 15 class BookmarkModel; |
| 16 class Profile; | 16 class Profile; |
| 17 | 17 |
| 18 class ChromeBookmarkClient : public BookmarkClient, | 18 class ChromeBookmarkClient : public BookmarkClient, |
| 19 public content::NotificationObserver, | 19 public content::NotificationObserver, |
| 20 public KeyedService, | |
| 21 public BaseBookmarkModelObserver { | 20 public BaseBookmarkModelObserver { |
| 22 public: | 21 public: |
| 23 // |index_urls| says whether URLs should be stored in the BookmarkIndex | 22 explicit ChromeBookmarkClient(Profile* profile); |
| 24 // in addition to bookmark titles. | |
| 25 ChromeBookmarkClient(Profile* profile, bool index_urls); | |
| 26 virtual ~ChromeBookmarkClient(); | 23 virtual ~ChromeBookmarkClient(); |
| 27 | 24 |
| 28 // Returns the BookmarkModel that corresponds to this ChromeBookmarkClient. | 25 void Init(BookmarkModel* model); |
| 29 BookmarkModel* model() { return model_.get(); } | 26 |
| 27 // KeyedService: | |
| 28 virtual void Shutdown() OVERRIDE; | |
| 30 | 29 |
| 31 // BookmarkClient: | 30 // BookmarkClient: |
| 32 virtual bool PreferTouchIcon() OVERRIDE; | 31 virtual bool PreferTouchIcon() OVERRIDE; |
| 33 virtual base::CancelableTaskTracker::TaskId GetFaviconImageForURL( | 32 virtual base::CancelableTaskTracker::TaskId GetFaviconImageForURL( |
| 34 const GURL& page_url, | 33 const GURL& page_url, |
| 35 int icon_types, | 34 int icon_types, |
| 36 int desired_size_in_dip, | 35 int desired_size_in_dip, |
| 37 const favicon_base::FaviconImageCallback& callback, | 36 const favicon_base::FaviconImageCallback& callback, |
| 38 base::CancelableTaskTracker* tracker) OVERRIDE; | 37 base::CancelableTaskTracker* tracker) OVERRIDE; |
| 39 virtual bool SupportsTypedCountForNodes() OVERRIDE; | 38 virtual bool SupportsTypedCountForNodes() OVERRIDE; |
| 40 virtual void GetTypedCountForNodes( | 39 virtual void GetTypedCountForNodes( |
| 41 const NodeSet& nodes, | 40 const NodeSet& nodes, |
| 42 NodeTypedCountPairs* node_typed_count_pairs) OVERRIDE; | 41 NodeTypedCountPairs* node_typed_count_pairs) OVERRIDE; |
| 43 virtual bool IsPermanentNodeVisible(int node_type) OVERRIDE; | 42 virtual bool IsPermanentNodeVisible(int node_type) OVERRIDE; |
| 44 virtual void RecordAction(const base::UserMetricsAction& action) OVERRIDE; | 43 virtual void RecordAction(const base::UserMetricsAction& action) OVERRIDE; |
| 45 | 44 |
| 46 // content::NotificationObserver: | 45 // content::NotificationObserver: |
| 47 virtual void Observe(int type, | 46 virtual void Observe(int type, |
| 48 const content::NotificationSource& source, | 47 const content::NotificationSource& source, |
| 49 const content::NotificationDetails& details) OVERRIDE; | 48 const content::NotificationDetails& details) OVERRIDE; |
| 50 | 49 |
| 51 // KeyedService: | |
| 52 virtual void Shutdown() OVERRIDE; | |
| 53 | |
| 54 private: | 50 private: |
| 55 // BaseBookmarkModelObserver: | 51 // BaseBookmarkModelObserver: |
| 56 virtual void BookmarkModelChanged() OVERRIDE; | 52 virtual void BookmarkModelChanged() OVERRIDE; |
| 57 virtual void BookmarkNodeRemoved(BookmarkModel* model, | 53 virtual void BookmarkNodeRemoved(BookmarkModel* model, |
| 58 const BookmarkNode* parent, | 54 const BookmarkNode* parent, |
| 59 int old_index, | 55 int old_index, |
| 60 const BookmarkNode* node, | 56 const BookmarkNode* node, |
| 61 const std::set<GURL>& removed_urls) OVERRIDE; | 57 const std::set<GURL>& removed_urls) OVERRIDE; |
| 62 virtual void BookmarkAllNodesRemoved( | 58 virtual void BookmarkAllNodesRemoved( |
| 63 BookmarkModel* model, | 59 BookmarkModel* model, |
| 64 const std::set<GURL>& removed_urls) OVERRIDE; | 60 const std::set<GURL>& removed_urls) OVERRIDE; |
| 65 | 61 |
| 66 Profile* profile_; | 62 Profile* profile_; |
| 67 | 63 |
| 68 content::NotificationRegistrar registrar_; | 64 content::NotificationRegistrar registrar_; |
| 69 | 65 |
| 70 scoped_ptr<BookmarkModel> model_; | 66 BookmarkModel* model_; |
| 71 | 67 |
| 72 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClient); | 68 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClient); |
| 73 }; | 69 }; |
| 74 | 70 |
| 75 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ | 71 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ |
| OLD | NEW |