| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_BOOKMARKS_BOOKMARK_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include "components/bookmarks/browser/base_bookmark_model_observer.h" | 8 #include "components/bookmarks/browser/base_bookmark_model_observer.h" |
| 9 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
| 10 #include "content/public/browser/web_contents_user_data.h" | 10 #include "content/public/browser/web_contents_user_data.h" |
| 11 | 11 |
| 12 class BookmarkTabHelperDelegate; |
| 13 |
| 14 namespace bookmarks { |
| 12 struct BookmarkNodeData; | 15 struct BookmarkNodeData; |
| 13 class BookmarkTabHelperDelegate; | 16 } |
| 14 | 17 |
| 15 namespace content { | 18 namespace content { |
| 16 class WebContents; | 19 class WebContents; |
| 17 } | 20 } |
| 18 | 21 |
| 19 // Per-tab class to manage bookmarks. | 22 // Per-tab class to manage bookmarks. |
| 20 class BookmarkTabHelper | 23 class BookmarkTabHelper |
| 21 : public BaseBookmarkModelObserver, | 24 : public BaseBookmarkModelObserver, |
| 22 public content::WebContentsObserver, | 25 public content::WebContentsObserver, |
| 23 public content::WebContentsUserData<BookmarkTabHelper> { | 26 public content::WebContentsUserData<BookmarkTabHelper> { |
| 24 public: | 27 public: |
| 25 // Interface for forwarding bookmark drag and drop to extenstions. | 28 // Interface for forwarding bookmark drag and drop to extenstions. |
| 26 class BookmarkDrag { | 29 class BookmarkDrag { |
| 27 public: | 30 public: |
| 28 virtual void OnDragEnter(const BookmarkNodeData& data) = 0; | 31 virtual void OnDragEnter(const bookmarks::BookmarkNodeData& data) = 0; |
| 29 virtual void OnDragOver(const BookmarkNodeData& data) = 0; | 32 virtual void OnDragOver(const bookmarks::BookmarkNodeData& data) = 0; |
| 30 virtual void OnDragLeave(const BookmarkNodeData& data) = 0; | 33 virtual void OnDragLeave(const bookmarks::BookmarkNodeData& data) = 0; |
| 31 virtual void OnDrop(const BookmarkNodeData& data) = 0; | 34 virtual void OnDrop(const bookmarks::BookmarkNodeData& data) = 0; |
| 32 | 35 |
| 33 protected: | 36 protected: |
| 34 virtual ~BookmarkDrag() {} | 37 virtual ~BookmarkDrag() {} |
| 35 }; | 38 }; |
| 36 | 39 |
| 37 virtual ~BookmarkTabHelper(); | 40 virtual ~BookmarkTabHelper(); |
| 38 | 41 |
| 39 void set_delegate(BookmarkTabHelperDelegate* delegate) { | 42 void set_delegate(BookmarkTabHelperDelegate* delegate) { |
| 40 delegate_ = delegate; | 43 delegate_ = delegate; |
| 41 } | 44 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 BookmarkTabHelperDelegate* delegate_; | 98 BookmarkTabHelperDelegate* delegate_; |
| 96 | 99 |
| 97 // The BookmarkDrag is used to forward bookmark drag and drop events to | 100 // The BookmarkDrag is used to forward bookmark drag and drop events to |
| 98 // extensions. | 101 // extensions. |
| 99 BookmarkDrag* bookmark_drag_; | 102 BookmarkDrag* bookmark_drag_; |
| 100 | 103 |
| 101 DISALLOW_COPY_AND_ASSIGN(BookmarkTabHelper); | 104 DISALLOW_COPY_AND_ASSIGN(BookmarkTabHelper); |
| 102 }; | 105 }; |
| 103 | 106 |
| 104 #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_TAB_HELPER_H_ | 107 #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_TAB_HELPER_H_ |
| OLD | NEW |