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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 kAlpha_8_SkColorType); | 129 kAlpha_8_SkColorType); |
130 } | 130 } |
131 | 131 |
132 void NavigationEntryScreenshotManager::SetMinScreenshotIntervalMS( | 132 void NavigationEntryScreenshotManager::SetMinScreenshotIntervalMS( |
133 int interval_ms) { | 133 int interval_ms) { |
134 DCHECK_GE(interval_ms, 0); | 134 DCHECK_GE(interval_ms, 0); |
135 min_screenshot_interval_ms_ = interval_ms; | 135 min_screenshot_interval_ms_ = interval_ms; |
136 } | 136 } |
137 | 137 |
138 void NavigationEntryScreenshotManager::OnScreenshotTaken(int unique_id, | 138 void NavigationEntryScreenshotManager::OnScreenshotTaken(int unique_id, |
139 bool success, | 139 bool success, |
140 const SkBitmap& bitmap) { | 140 const SkBitmap& bitmap, |
| 141 const int& response) { |
141 NavigationEntryImpl* entry = NULL; | 142 NavigationEntryImpl* entry = NULL; |
142 int entry_count = owner_->GetEntryCount(); | 143 int entry_count = owner_->GetEntryCount(); |
143 for (int i = 0; i < entry_count; ++i) { | 144 for (int i = 0; i < entry_count; ++i) { |
144 NavigationEntry* iter = owner_->GetEntryAtIndex(i); | 145 NavigationEntry* iter = owner_->GetEntryAtIndex(i); |
145 if (iter->GetUniqueID() == unique_id) { | 146 if (iter->GetUniqueID() == unique_id) { |
146 entry = NavigationEntryImpl::FromNavigationEntry(iter); | 147 entry = NavigationEntryImpl::FromNavigationEntry(iter); |
147 break; | 148 break; |
148 } | 149 } |
149 } | 150 } |
150 | 151 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 owner_->GetEntryAtIndex(forward)); | 273 owner_->GetEntryAtIndex(forward)); |
273 if (ClearScreenshot(entry)) | 274 if (ClearScreenshot(entry)) |
274 --screenshot_count; | 275 --screenshot_count; |
275 ++forward; | 276 ++forward; |
276 } | 277 } |
277 CHECK_GE(screenshot_count, 0); | 278 CHECK_GE(screenshot_count, 0); |
278 CHECK_LE(screenshot_count, kMaxScreenshots); | 279 CHECK_LE(screenshot_count, kMaxScreenshots); |
279 } | 280 } |
280 | 281 |
281 } // namespace content | 282 } // namespace content |
OLD | NEW |