Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: Source/web/FrameLoaderClientImpl.cpp

Issue 669013002: Remove BackForwardClient, cleanup starting a history navigation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/FrameLoaderClientImpl.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 if (m_webFrame->client()) 859 if (m_webFrame->client())
860 m_webFrame->client()->didAbortLoading(m_webFrame); 860 m_webFrame->client()->didAbortLoading(m_webFrame);
861 } 861 }
862 862
863 void FrameLoaderClientImpl::dispatchDidChangeManifest() 863 void FrameLoaderClientImpl::dispatchDidChangeManifest()
864 { 864 {
865 if (m_webFrame->client()) 865 if (m_webFrame->client())
866 m_webFrame->client()->didChangeManifest(m_webFrame); 866 m_webFrame->client()->didChangeManifest(m_webFrame);
867 } 867 }
868 868
869 unsigned FrameLoaderClientImpl::backForwardLength()
870 {
871 WebViewImpl* webview = m_webFrame->viewImpl();
872 if (!webview || !webview->client())
873 return 0;
874 return webview->client()->historyBackListCount() + 1 + webview->client()->hi storyForwardListCount();
875 }
876
869 } // namespace blink 877 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/FrameLoaderClientImpl.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698