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

Side by Side Diff: chrome/browser/thumbnails/thumbnail_tab_helper.cc

Issue 593503003: Support error handling for Surface readbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary headers. Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/thumbnails/thumbnail_tab_helper.h" 5 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/thumbnails/thumbnail_service.h" 9 #include "chrome/browser/thumbnails/thumbnail_service.h"
10 #include "chrome/browser/thumbnails/thumbnail_service_factory.h" 10 #include "chrome/browser/thumbnails/thumbnail_service_factory.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 const SkBitmap& thumbnail) { 57 const SkBitmap& thumbnail) {
58 gfx::Image image = gfx::Image::CreateFrom1xBitmap(thumbnail); 58 gfx::Image image = gfx::Image::CreateFrom1xBitmap(thumbnail);
59 context.service->SetPageThumbnail(context, image); 59 context.service->SetPageThumbnail(context, image);
60 VLOG(1) << "Thumbnail taken for " << context.url << ": " 60 VLOG(1) << "Thumbnail taken for " << context.url << ": "
61 << context.score.ToString(); 61 << context.score.ToString();
62 } 62 }
63 63
64 void ProcessCapturedBitmap(scoped_refptr<ThumbnailingContext> context, 64 void ProcessCapturedBitmap(scoped_refptr<ThumbnailingContext> context,
65 scoped_refptr<ThumbnailingAlgorithm> algorithm, 65 scoped_refptr<ThumbnailingAlgorithm> algorithm,
66 bool succeeded, 66 bool succeeded,
67 const SkBitmap& bitmap) { 67 const SkBitmap& bitmap,
68 const int& response) {
68 if (!succeeded) 69 if (!succeeded)
69 return; 70 return;
70 71
71 // On success, we must be on the UI thread (on failure because of shutdown we 72 // On success, we must be on the UI thread (on failure because of shutdown we
72 // are not on the UI thread). 73 // are not on the UI thread).
73 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 74 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
74 75
75 algorithm->ProcessBitmap(context, base::Bind(&UpdateThumbnail), bitmap); 76 algorithm->ProcessBitmap(context, base::Bind(&UpdateThumbnail), bitmap);
76 } 77 }
77 78
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, 220 content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED,
220 content::Source<RenderWidgetHost>(renderer)); 221 content::Source<RenderWidgetHost>(renderer));
221 } 222 }
222 } 223 }
223 224
224 void ThumbnailTabHelper::WidgetHidden(RenderWidgetHost* widget) { 225 void ThumbnailTabHelper::WidgetHidden(RenderWidgetHost* widget) {
225 if (!enabled_) 226 if (!enabled_)
226 return; 227 return;
227 UpdateThumbnailIfNecessary(web_contents()); 228 UpdateThumbnailIfNecessary(web_contents());
228 } 229 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/pdf/pdf_browsertest_base.h » ('j') | content/common/readback_types.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698