| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "BackForwardListClientImpl.h" | 32 #include "BackForwardListClientImpl.h" |
| 33 | 33 |
| 34 #include "HistoryItem.h" | 34 #include "HistoryItem.h" |
| 35 #include "WebViewClient.h" | 35 #include "WebViewClient.h" |
| 36 | 36 #include "WebViewImpl.h" |
| 37 // FIXME: Remove this once WebViewImpl moves out of glue/. | |
| 38 #include "webkit/glue/webview_impl.h" | |
| 39 | 37 |
| 40 using namespace WebCore; | 38 using namespace WebCore; |
| 41 | 39 |
| 42 namespace WebKit { | 40 namespace WebKit { |
| 43 | 41 |
| 44 const char backForwardNavigationScheme[] = "chrome-back-forward"; | 42 const char backForwardNavigationScheme[] = "chrome-back-forward"; |
| 45 | 43 |
| 46 BackForwardListClientImpl::BackForwardListClientImpl(WebViewImpl* webView) | 44 BackForwardListClientImpl::BackForwardListClientImpl(WebViewImpl* webView) |
| 47 : m_webView(webView) | 45 : m_webView(webView) |
| 48 { | 46 { |
| 49 } | 47 } |
| 50 | 48 |
| 51 BackForwardListClientImpl::~BackForwardListClientImpl() | 49 BackForwardListClientImpl::~BackForwardListClientImpl() |
| 52 { | 50 { |
| 53 } | 51 } |
| 54 | 52 |
| 55 void BackForwardListClientImpl::SetCurrentHistoryItem(HistoryItem* item) | 53 void BackForwardListClientImpl::setCurrentHistoryItem(HistoryItem* item) |
| 56 { | 54 { |
| 57 m_previousItem = m_currentItem; | 55 m_previousItem = m_currentItem; |
| 58 m_currentItem = item; | 56 m_currentItem = item; |
| 59 } | 57 } |
| 60 | 58 |
| 61 HistoryItem* BackForwardListClientImpl::GetPreviousHistoryItem() const | 59 HistoryItem* BackForwardListClientImpl::previousHistoryItem() const |
| 62 { | 60 { |
| 63 return m_previousItem.get(); | 61 return m_previousItem.get(); |
| 64 } | 62 } |
| 65 | 63 |
| 66 void BackForwardListClientImpl::addItem(PassRefPtr<HistoryItem> item) | 64 void BackForwardListClientImpl::addItem(PassRefPtr<HistoryItem> item) |
| 67 { | 65 { |
| 68 m_previousItem = m_currentItem; | 66 m_previousItem = m_currentItem; |
| 69 m_currentItem = item; | 67 m_currentItem = item; |
| 70 | 68 |
| 71 // If WebCore adds a new HistoryItem, it means this is a new navigation (ie, | 69 // If WebCore adds a new HistoryItem, it means this is a new navigation (ie, |
| 72 // not a reload or back/forward). | 70 // not a reload or back/forward). |
| 73 m_webView->ObserveNewNavigation(); | 71 m_webView->observeNewNavigation(); |
| 74 | 72 |
| 75 if (m_webView->client()) | 73 if (m_webView->client()) |
| 76 m_webView->client()->didAddHistoryItem(); | 74 m_webView->client()->didAddHistoryItem(); |
| 77 } | 75 } |
| 78 | 76 |
| 79 void BackForwardListClientImpl::goToItem(HistoryItem* item) | 77 void BackForwardListClientImpl::goToItem(HistoryItem* item) |
| 80 { | 78 { |
| 81 m_previousItem = m_currentItem; | 79 m_previousItem = m_currentItem; |
| 82 m_currentItem = item; | 80 m_currentItem = item; |
| 83 | 81 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 127 } |
| 130 | 128 |
| 131 void BackForwardListClientImpl::close() | 129 void BackForwardListClientImpl::close() |
| 132 { | 130 { |
| 133 m_currentItem = 0; | 131 m_currentItem = 0; |
| 134 m_previousItem = 0; | 132 m_previousItem = 0; |
| 135 m_pendingHistoryItem = 0; | 133 m_pendingHistoryItem = 0; |
| 136 } | 134 } |
| 137 | 135 |
| 138 } // namespace WebKit | 136 } // namespace WebKit |
| OLD | NEW |