| 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 "chrome/browser/common/web_contents_user_data.h" | 8 #include "chrome/browser/common/web_contents_user_data.h" |
| 9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // |bookmark_drag| is deleted since this class does not take ownership of | 59 // |bookmark_drag| is deleted since this class does not take ownership of |
| 60 // |bookmark_drag|. | 60 // |bookmark_drag|. |
| 61 void SetBookmarkDragDelegate( | 61 void SetBookmarkDragDelegate( |
| 62 BookmarkTabHelper::BookmarkDrag* bookmark_drag); | 62 BookmarkTabHelper::BookmarkDrag* bookmark_drag); |
| 63 // The BookmarkDragDelegate is used to forward bookmark drag and drop events | 63 // The BookmarkDragDelegate is used to forward bookmark drag and drop events |
| 64 // to extensions. | 64 // to extensions. |
| 65 BookmarkTabHelper::BookmarkDrag* GetBookmarkDragDelegate(); | 65 BookmarkTabHelper::BookmarkDrag* GetBookmarkDragDelegate(); |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 explicit BookmarkTabHelper(content::WebContents* web_contents); | 68 explicit BookmarkTabHelper(content::WebContents* web_contents); |
| 69 static int kUserDataKey; | |
| 70 friend class WebContentsUserData<BookmarkTabHelper>; | 69 friend class WebContentsUserData<BookmarkTabHelper>; |
| 71 | 70 |
| 72 // Updates the starred state from the bookmark bar model. If the state has | 71 // Updates the starred state from the bookmark bar model. If the state has |
| 73 // changed, the delegate is notified. | 72 // changed, the delegate is notified. |
| 74 void UpdateStarredStateForCurrentURL(); | 73 void UpdateStarredStateForCurrentURL(); |
| 75 | 74 |
| 76 // Whether the current URL is starred. | 75 // Whether the current URL is starred. |
| 77 bool is_starred_; | 76 bool is_starred_; |
| 78 | 77 |
| 79 // Registers and unregisters us for notifications. | 78 // Registers and unregisters us for notifications. |
| 80 content::NotificationRegistrar registrar_; | 79 content::NotificationRegistrar registrar_; |
| 81 | 80 |
| 82 // Delegate for notifying our owner (usually Browser) about stuff. Not owned | 81 // Delegate for notifying our owner (usually Browser) about stuff. Not owned |
| 83 // by us. | 82 // by us. |
| 84 BookmarkTabHelperDelegate* delegate_; | 83 BookmarkTabHelperDelegate* delegate_; |
| 85 | 84 |
| 86 // Handles drag and drop event forwarding to extensions. | 85 // Handles drag and drop event forwarding to extensions. |
| 87 BookmarkDrag* bookmark_drag_; | 86 BookmarkDrag* bookmark_drag_; |
| 88 | 87 |
| 89 DISALLOW_COPY_AND_ASSIGN(BookmarkTabHelper); | 88 DISALLOW_COPY_AND_ASSIGN(BookmarkTabHelper); |
| 90 }; | 89 }; |
| 91 | 90 |
| 92 #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_TAB_HELPER_H_ | 91 #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_TAB_HELPER_H_ |
| OLD | NEW |