| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_GLUE_BACK_FORWARD_LIST_CLIENT_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_BACK_FORWARD_LIST_CLIENT_IMPL_H_ |
| 6 #define WEBKIT_GLUE_BACK_FORWARD_LIST_CLIENT_IMPL_H_ | 6 #define WEBKIT_GLUE_BACK_FORWARD_LIST_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "BackForwardList.h" | 8 #include "BackForwardList.h" |
| 9 | 9 |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| 11 | 11 |
| 12 class WebHistoryItemImpl; | 12 class WebHistoryItemImpl; |
| 13 class WebViewImpl; | 13 class WebViewImpl; |
| 14 | 14 |
| 15 namespace webkit_glue { | 15 namespace webkit_glue { |
| 16 | 16 |
| 17 class BackForwardListClientImpl : public WebCore::BackForwardListClient { | 17 class BackForwardListClientImpl : public WebCore::BackForwardListClient { |
| 18 public: | 18 public: |
| 19 BackForwardListClientImpl(WebViewImpl* webview); | 19 BackForwardListClientImpl(WebViewImpl* webview); |
| 20 ~BackForwardListClientImpl(); | 20 ~BackForwardListClientImpl(); |
| 21 | 21 |
| 22 void SetCurrentHistoryItem(WebCore::HistoryItem* item); | 22 void SetCurrentHistoryItem(WebCore::HistoryItem* item); |
| 23 WebCore::HistoryItem* GetPreviousHistoryItem(); | 23 WebCore::HistoryItem* GetPreviousHistoryItem() const; |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 // WebCore::BackForwardListClient methods: | 26 // WebCore::BackForwardListClient methods: |
| 27 virtual void addItem(PassRefPtr<WebCore::HistoryItem> item); | 27 virtual void addItem(PassRefPtr<WebCore::HistoryItem> item); |
| 28 virtual void goToItem(WebCore::HistoryItem* item); | 28 virtual void goToItem(WebCore::HistoryItem* item); |
| 29 virtual WebCore::HistoryItem* currentItem(); | 29 virtual WebCore::HistoryItem* currentItem(); |
| 30 virtual WebCore::HistoryItem* itemAtIndex(int index); | 30 virtual WebCore::HistoryItem* itemAtIndex(int index); |
| 31 virtual int backListCount(); | 31 virtual int backListCount(); |
| 32 virtual int forwardListCount(); | 32 virtual int forwardListCount(); |
| 33 virtual void close(); | 33 virtual void close(); |
| 34 | 34 |
| 35 WebViewImpl* webview_; | 35 WebViewImpl* webview_; |
| 36 | 36 |
| 37 RefPtr<WebCore::HistoryItem> previous_item_; | 37 RefPtr<WebCore::HistoryItem> previous_item_; |
| 38 RefPtr<WebCore::HistoryItem> current_item_; | 38 RefPtr<WebCore::HistoryItem> current_item_; |
| 39 | 39 |
| 40 // The last history item that was accessed via itemAtIndex(). We keep track | 40 // The last history item that was accessed via itemAtIndex(). We keep track |
| 41 // of this until goToItem() is called, so we can track the navigation. | 41 // of this until goToItem() is called, so we can track the navigation. |
| 42 scoped_refptr<WebHistoryItemImpl> pending_history_item_; | 42 scoped_refptr<WebHistoryItemImpl> pending_history_item_; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace webkit_glue | 45 } // namespace webkit_glue |
| 46 | 46 |
| 47 #endif // WEBKIT_GLUE_BACK_FORWARD_LIST_CLIENT_IMPL_H_ | 47 #endif // WEBKIT_GLUE_BACK_FORWARD_LIST_CLIENT_IMPL_H_ |
| OLD | NEW |