OLD | NEW |
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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 return NULL; | 472 return NULL; |
473 | 473 |
474 return entries_[index].get(); | 474 return entries_[index].get(); |
475 } | 475 } |
476 | 476 |
477 int NavigationControllerImpl::GetIndexForOffset(int offset) const { | 477 int NavigationControllerImpl::GetIndexForOffset(int offset) const { |
478 return GetCurrentEntryIndex() + offset; | 478 return GetCurrentEntryIndex() + offset; |
479 } | 479 } |
480 | 480 |
481 void NavigationControllerImpl::TakeScreenshot() { | 481 void NavigationControllerImpl::TakeScreenshot() { |
482 static bool overscroll_enabled = !CommandLine::ForCurrentProcess()-> | 482 static bool overscroll_enabled = CommandLine::ForCurrentProcess()-> |
483 HasSwitch(switches::kDisableOverscrollHistoryNavigation); | 483 HasSwitch(switches::kEnableOverscrollHistoryNavigation); |
484 if (!overscroll_enabled) | 484 if (!overscroll_enabled) |
485 return; | 485 return; |
486 | 486 |
487 NavigationEntryImpl* entry = | 487 NavigationEntryImpl* entry = |
488 NavigationEntryImpl::FromNavigationEntry(GetLastCommittedEntry()); | 488 NavigationEntryImpl::FromNavigationEntry(GetLastCommittedEntry()); |
489 if (!entry) | 489 if (!entry) |
490 return; | 490 return; |
491 | 491 |
492 RenderViewHost* render_view_host = web_contents_->GetRenderViewHost(); | 492 RenderViewHost* render_view_host = web_contents_->GetRenderViewHost(); |
493 if (!static_cast<RenderViewHostImpl*> | 493 if (!static_cast<RenderViewHostImpl*> |
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1779 const base::Callback<base::Time()>& get_timestamp_callback) { | 1779 const base::Callback<base::Time()>& get_timestamp_callback) { |
1780 get_timestamp_callback_ = get_timestamp_callback; | 1780 get_timestamp_callback_ = get_timestamp_callback; |
1781 } | 1781 } |
1782 | 1782 |
1783 void NavigationControllerImpl::SetTakeScreenshotCallbackForTest( | 1783 void NavigationControllerImpl::SetTakeScreenshotCallbackForTest( |
1784 const base::Callback<void(RenderViewHost*)>& take_screenshot_callback) { | 1784 const base::Callback<void(RenderViewHost*)>& take_screenshot_callback) { |
1785 take_screenshot_callback_ = take_screenshot_callback; | 1785 take_screenshot_callback_ = take_screenshot_callback; |
1786 } | 1786 } |
1787 | 1787 |
1788 } // namespace content | 1788 } // namespace content |
OLD | NEW |