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/navigation_entry_screenshot_manager.h" | 5 #include "content/browser/frame_host/navigation_entry_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/frame_host/navigation_controller_impl.h" | 9 #include "content/browser/frame_host/navigation_controller_impl.h" |
10 #include "content/browser/frame_host/navigation_entry_impl.h" | 10 #include "content/browser/frame_host/navigation_entry_impl.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 if (!overscroll_enabled) | 91 if (!overscroll_enabled) |
92 return; | 92 return; |
93 | 93 |
94 NavigationEntryImpl* entry = | 94 NavigationEntryImpl* entry = |
95 NavigationEntryImpl::FromNavigationEntry(owner_->GetLastCommittedEntry()); | 95 NavigationEntryImpl::FromNavigationEntry(owner_->GetLastCommittedEntry()); |
96 if (!entry) | 96 if (!entry) |
97 return; | 97 return; |
98 | 98 |
99 RenderViewHost* render_view_host = | 99 RenderViewHost* render_view_host = |
100 owner_->delegate()->GetRenderViewHost(); | 100 owner_->delegate()->GetRenderViewHost(); |
101 if (!static_cast<RenderViewHostImpl*> | 101 // TODO(jdduke): Determine if necessary? |
102 /*if (!static_cast<RenderViewHostImpl*> | |
102 (render_view_host)->overscroll_controller()) { | 103 (render_view_host)->overscroll_controller()) { |
103 return; | 104 return; |
104 } | 105 }*/ |
sadrul
2014/05/22 16:18:27
The screenshots are used only when overscroll is t
jdduke (slow)
2014/05/22 16:21:31
Any ideas on another way to plumb through this dat
sadrul
2014/05/22 16:53:20
We compile it on all platforms, yeah.
Maybe we co
jdduke (slow)
2014/05/22 19:29:38
Hmm, I started down that road and found some runti
| |
105 content::RenderWidgetHostView* view = render_view_host->GetView(); | 106 content::RenderWidgetHostView* view = render_view_host->GetView(); |
106 if (!view) | 107 if (!view) |
107 return; | 108 return; |
108 | 109 |
109 // Make sure screenshots aren't taken too frequently. | 110 // Make sure screenshots aren't taken too frequently. |
110 base::Time now = base::Time::Now(); | 111 base::Time now = base::Time::Now(); |
111 if (now - last_screenshot_time_ < | 112 if (now - last_screenshot_time_ < |
112 base::TimeDelta::FromMilliseconds(min_screenshot_interval_ms_)) { | 113 base::TimeDelta::FromMilliseconds(min_screenshot_interval_ms_)) { |
113 return; | 114 return; |
114 } | 115 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
287 owner_->GetEntryAtIndex(forward)); | 288 owner_->GetEntryAtIndex(forward)); |
288 if (ClearScreenshot(entry)) | 289 if (ClearScreenshot(entry)) |
289 --screenshot_count; | 290 --screenshot_count; |
290 ++forward; | 291 ++forward; |
291 } | 292 } |
292 CHECK_GE(screenshot_count, 0); | 293 CHECK_GE(screenshot_count, 0); |
293 CHECK_LE(screenshot_count, kMaxScreenshots); | 294 CHECK_LE(screenshot_count, kMaxScreenshots); |
294 } | 295 } |
295 | 296 |
296 } // namespace content | 297 } // namespace content |
OLD | NEW |