Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
| 10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 } | 452 } |
| 453 | 453 |
| 454 if (ui::PageTransitionIsMainFrame(params.transition)) { | 454 if (ui::PageTransitionIsMainFrame(params.transition)) { |
| 455 if (delegate_) { | 455 if (delegate_) { |
| 456 // When overscroll navigation gesture is enabled, a screenshot of the page | 456 // When overscroll navigation gesture is enabled, a screenshot of the page |
| 457 // in its current state is taken so that it can be used during the | 457 // in its current state is taken so that it can be used during the |
| 458 // nav-gesture. It is necessary to take the screenshot here, before | 458 // nav-gesture. It is necessary to take the screenshot here, before |
| 459 // calling RenderFrameHostManager::DidNavigateMainFrame, because that can | 459 // calling RenderFrameHostManager::DidNavigateMainFrame, because that can |
| 460 // change WebContents::GetRenderViewHost to return the new host, instead | 460 // change WebContents::GetRenderViewHost to return the new host, instead |
| 461 // of the one that may have just been swapped out. | 461 // of the one that may have just been swapped out. |
| 462 if (delegate_->CanOverscrollContent()) { | 462 if (controller_->ShouldTakeScreenshotOnNavigation()) { |
|
sadrul
2014/09/29 20:39:24
Can we change the Browser::CanOverscrollContent()
mfomitchev
2014/09/29 20:41:39
This was my first intention, but then I thought it
| |
| 463 // Don't take screenshots if we are staying on the same page. We want | 463 // Don't take screenshots if we are staying on the same page. We want |
| 464 // in-page navigations to be super fast, and taking a screenshot | 464 // in-page navigations to be super fast, and taking a screenshot |
| 465 // currently blocks GPU for a longer time than we are willing to | 465 // currently blocks GPU for a longer time than we are willing to |
| 466 // tolerate in this use case. | 466 // tolerate in this use case. |
| 467 if (!params.was_within_same_page) | 467 if (!params.was_within_same_page) |
| 468 controller_->TakeScreenshot(); | 468 controller_->TakeScreenshot(); |
| 469 } | 469 } |
| 470 | 470 |
| 471 // Run tasks that must execute just before the commit. | 471 // Run tasks that must execute just before the commit. |
| 472 bool is_navigation_within_page = controller_->IsURLInPageNavigation( | 472 bool is_navigation_within_page = controller_->IsURLInPageNavigation( |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 682 controller_->GetBrowserContext(), url); | 682 controller_->GetBrowserContext(), url); |
| 683 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && | 683 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && |
| 684 !is_allowed_in_web_ui_renderer) { | 684 !is_allowed_in_web_ui_renderer) { |
| 685 // Log the URL to help us diagnose any future failures of this CHECK. | 685 // Log the URL to help us diagnose any future failures of this CHECK. |
| 686 GetContentClient()->SetActiveURL(url); | 686 GetContentClient()->SetActiveURL(url); |
| 687 CHECK(0); | 687 CHECK(0); |
| 688 } | 688 } |
| 689 } | 689 } |
| 690 | 690 |
| 691 } // namespace content | 691 } // namespace content |
| OLD | NEW |