OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/web_contents/web_contents_screenshot_manager.h" | 5 #include "content/browser/web_contents/web_contents_screenshot_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/threading/worker_pool.h" | 8 #include "base/threading/worker_pool.h" |
9 #include "content/browser/renderer_host/render_view_host_impl.h" | 9 #include "content/browser/renderer_host/render_view_host_impl.h" |
10 #include "content/browser/web_contents/navigation_controller_impl.h" | 10 #include "content/browser/web_contents/navigation_controller_impl.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 : owner_(owner), | 64 : owner_(owner), |
65 screenshot_factory_(this), | 65 screenshot_factory_(this), |
66 min_screenshot_interval_ms_(kMinScreenshotIntervalMS) { | 66 min_screenshot_interval_ms_(kMinScreenshotIntervalMS) { |
67 } | 67 } |
68 | 68 |
69 WebContentsScreenshotManager::~WebContentsScreenshotManager() { | 69 WebContentsScreenshotManager::~WebContentsScreenshotManager() { |
70 } | 70 } |
71 | 71 |
72 void WebContentsScreenshotManager::TakeScreenshot() { | 72 void WebContentsScreenshotManager::TakeScreenshot() { |
73 static bool overscroll_enabled = CommandLine::ForCurrentProcess()-> | 73 static bool overscroll_enabled = CommandLine::ForCurrentProcess()-> |
74 GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) != "0"; | 74 GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) == "1"; |
75 if (!overscroll_enabled) | 75 if (!overscroll_enabled) |
76 return; | 76 return; |
77 | 77 |
78 NavigationEntryImpl* entry = | 78 NavigationEntryImpl* entry = |
79 NavigationEntryImpl::FromNavigationEntry(owner_->GetLastCommittedEntry()); | 79 NavigationEntryImpl::FromNavigationEntry(owner_->GetLastCommittedEntry()); |
80 if (!entry) | 80 if (!entry) |
81 return; | 81 return; |
82 | 82 |
83 RenderViewHost* render_view_host = | 83 RenderViewHost* render_view_host = |
84 owner_->web_contents()->GetRenderViewHost(); | 84 owner_->web_contents()->GetRenderViewHost(); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 owner_->GetEntryAtIndex(forward)); | 263 owner_->GetEntryAtIndex(forward)); |
264 if (ClearScreenshot(entry)) | 264 if (ClearScreenshot(entry)) |
265 --screenshot_count; | 265 --screenshot_count; |
266 ++forward; | 266 ++forward; |
267 } | 267 } |
268 CHECK_GE(screenshot_count, 0); | 268 CHECK_GE(screenshot_count, 0); |
269 CHECK_LE(screenshot_count, kMaxScreenshots); | 269 CHECK_LE(screenshot_count, kMaxScreenshots); |
270 } | 270 } |
271 | 271 |
272 } // namespace content | 272 } // namespace content |
OLD | NEW |