Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 533 } | 533 } |
| 534 } | 534 } |
| 535 | 535 |
| 536 bool FrameLoaderClientImpl::navigateBackForward(int offset) const | 536 bool FrameLoaderClientImpl::navigateBackForward(int offset) const |
| 537 { | 537 { |
| 538 WebViewImpl* webview = m_webFrame->viewImpl(); | 538 WebViewImpl* webview = m_webFrame->viewImpl(); |
| 539 if (!webview->client()) | 539 if (!webview->client()) |
| 540 return false; | 540 return false; |
| 541 | 541 |
| 542 ASSERT(offset); | 542 ASSERT(offset); |
| 543 offset = std::min(offset, webview->client()->historyForwardListCount()); | 543 if (offset > webview->client()->historyForwardListCount()) |
| 544 offset = std::max(offset, -webview->client()->historyBackListCount()); | 544 return false; |
|
Nate Chapin
2014/10/22 19:57:18
This min/max bounding is unnecessary. For backspac
| |
| 545 if (!offset) | 545 if (offset < -webview->client()->historyBackListCount()) |
| 546 return false; | 546 return false; |
| 547 webview->client()->navigateBackForwardSoon(offset); | 547 webview->client()->navigateBackForwardSoon(offset); |
| 548 return true; | 548 return true; |
| 549 } | 549 } |
| 550 | 550 |
| 551 void FrameLoaderClientImpl::didAccessInitialDocument() | 551 void FrameLoaderClientImpl::didAccessInitialDocument() |
| 552 { | 552 { |
| 553 if (m_webFrame->client()) | 553 if (m_webFrame->client()) |
| 554 m_webFrame->client()->didAccessInitialDocument(m_webFrame); | 554 m_webFrame->client()->didAccessInitialDocument(m_webFrame); |
| 555 } | 555 } |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 852 if (m_webFrame->client()) | 852 if (m_webFrame->client()) |
| 853 m_webFrame->client()->didAbortLoading(m_webFrame); | 853 m_webFrame->client()->didAbortLoading(m_webFrame); |
| 854 } | 854 } |
| 855 | 855 |
| 856 void FrameLoaderClientImpl::dispatchDidChangeManifest() | 856 void FrameLoaderClientImpl::dispatchDidChangeManifest() |
| 857 { | 857 { |
| 858 if (m_webFrame->client()) | 858 if (m_webFrame->client()) |
| 859 m_webFrame->client()->didChangeManifest(m_webFrame); | 859 m_webFrame->client()->didChangeManifest(m_webFrame); |
| 860 } | 860 } |
| 861 | 861 |
| 862 unsigned FrameLoaderClientImpl::backForwardLength() | |
| 863 { | |
| 864 WebViewImpl* webview = m_webFrame->viewImpl(); | |
| 865 if (!webview || !webview->client()) | |
| 866 return 0; | |
| 867 return webview->client()->historyBackListCount() + 1 + webview->client()->hi storyForwardListCount(); | |
| 868 } | |
| 869 | |
| 862 } // namespace blink | 870 } // namespace blink |
| OLD | NEW |