Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1375)

Unified Diff: content/browser/web_contents/navigation_controller_impl.cc

Issue 11958002: overscroll: Make sure screenshot for a NavigationEntry gets reset properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/web_contents/navigation_entry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/navigation_controller_impl.cc
diff --git a/content/browser/web_contents/navigation_controller_impl.cc b/content/browser/web_contents/navigation_controller_impl.cc
index 150ff546a5cfae2a4d1983677ea9147ca86a9c03..b66d6692ceffe56a7dcf125acf32779728889667 100644
--- a/content/browser/web_contents/navigation_controller_impl.cc
+++ b/content/browser/web_contents/navigation_controller_impl.cc
@@ -510,12 +510,6 @@ void NavigationControllerImpl::OnScreenshotTaken(
int unique_id,
skia::PlatformBitmap* bitmap,
bool success) {
- if (!success) {
- LOG(ERROR) << "Taking snapshot was unsuccessful for "
- << unique_id;
- return;
- }
-
NavigationEntryImpl* entry = NULL;
for (NavigationEntries::iterator i = entries_.begin();
i != entries_.end();
@@ -531,9 +525,18 @@ void NavigationControllerImpl::OnScreenshotTaken(
return;
}
+ if (!success) {
+ LOG(ERROR) << "Taking snapshot was unsuccessful for "
+ << unique_id;
+ entry->SetScreenshotPNGData(std::vector<unsigned char>());
+ return;
+ }
+
std::vector<unsigned char> data;
if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap->GetBitmap(), true, &data))
entry->SetScreenshotPNGData(data);
+ else
+ entry->SetScreenshotPNGData(std::vector<unsigned char>());
}
bool NavigationControllerImpl::CanGoBack() const {
« no previous file with comments | « no previous file | content/browser/web_contents/navigation_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698