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

Side by Side Diff: content/browser/web_contents/navigation_controller_impl.cc

Issue 11776010: overscroll: Take a screenshot at more appropriate times. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 11 months 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
OLDNEW
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 #include "content/browser/web_contents/navigation_controller_impl.h" 5 #include "content/browser/web_contents/navigation_controller_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 LoadEntry(entry); 745 LoadEntry(entry);
746 } 746 }
747 747
748 void NavigationControllerImpl::DocumentLoadedInFrame() { 748 void NavigationControllerImpl::DocumentLoadedInFrame() {
749 is_initial_navigation_ = false; 749 is_initial_navigation_ = false;
750 } 750 }
751 751
752 bool NavigationControllerImpl::RendererDidNavigate( 752 bool NavigationControllerImpl::RendererDidNavigate(
753 const ViewHostMsg_FrameNavigate_Params& params, 753 const ViewHostMsg_FrameNavigate_Params& params,
754 LoadCommittedDetails* details) { 754 LoadCommittedDetails* details) {
755 // When navigating away from the current page, take a screenshot of it in the
756 // current state so that it can be used during an overscroll-navigation
757 // gesture.
758 if (details->is_main_frame)
759 TakeScreenshot();
760
761 // Save the previous state before we clobber it. 755 // Save the previous state before we clobber it.
762 if (GetLastCommittedEntry()) { 756 if (GetLastCommittedEntry()) {
763 details->previous_url = GetLastCommittedEntry()->GetURL(); 757 details->previous_url = GetLastCommittedEntry()->GetURL();
764 details->previous_entry_index = GetLastCommittedEntryIndex(); 758 details->previous_entry_index = GetLastCommittedEntryIndex();
765 } else { 759 } else {
766 details->previous_url = GURL(); 760 details->previous_url = GURL();
767 details->previous_entry_index = -1; 761 details->previous_entry_index = -1;
768 } 762 }
769 763
770 // If we have a pending entry at this point, it should have a SiteInstance. 764 // If we have a pending entry at this point, it should have a SiteInstance.
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
1676 } 1670 }
1677 } 1671 }
1678 } 1672 }
1679 1673
1680 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 1674 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
1681 const base::Callback<base::Time()>& get_timestamp_callback) { 1675 const base::Callback<base::Time()>& get_timestamp_callback) {
1682 get_timestamp_callback_ = get_timestamp_callback; 1676 get_timestamp_callback_ = get_timestamp_callback;
1683 } 1677 }
1684 1678
1685 } // namespace content 1679 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698