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

Side by Side Diff: chrome/browser/tab_contents/thumbnail_generator.cc

Issue 6386009: Remove app/win/win_util.h,cc etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with NSApp changes in r73581 Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/tab_contents/thumbnail_generator.h" 5 #include "chrome/browser/tab_contents/thumbnail_generator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/scoped_ptr.h" 11 #include "base/scoped_ptr.h"
(...skipping 12 matching lines...) Expand all
24 #include "gfx/color_utils.h" 24 #include "gfx/color_utils.h"
25 #include "gfx/rect.h" 25 #include "gfx/rect.h"
26 #include "gfx/skbitmap_operations.h" 26 #include "gfx/skbitmap_operations.h"
27 #include "googleurl/src/gurl.h" 27 #include "googleurl/src/gurl.h"
28 #include "skia/ext/bitmap_platform_device.h" 28 #include "skia/ext/bitmap_platform_device.h"
29 #include "skia/ext/image_operations.h" 29 #include "skia/ext/image_operations.h"
30 #include "skia/ext/platform_canvas.h" 30 #include "skia/ext/platform_canvas.h"
31 #include "third_party/skia/include/core/SkBitmap.h" 31 #include "third_party/skia/include/core/SkBitmap.h"
32 32
33 #if defined(OS_WIN) 33 #if defined(OS_WIN)
34 #include "app/win/win_util.h" 34 #include "chrome/common/section_util_win.h"
35 #endif 35 #endif
36 36
37 // Overview 37 // Overview
38 // -------- 38 // --------
39 // This class provides current thumbnails for tabs. The simplest operation is 39 // This class provides current thumbnails for tabs. The simplest operation is
40 // when a request for a thumbnail comes in, to grab the backing store and make 40 // when a request for a thumbnail comes in, to grab the backing store and make
41 // a smaller version of that. 41 // a smaller version of that.
42 // 42 //
43 // A complication happens because we don't always have nice backing stores for 43 // A complication happens because we don't always have nice backing stores for
44 // all tabs (there is a cache of several tabs we'll keep backing stores for). 44 // all tabs (there is a cache of several tabs we'll keep backing stores for).
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // this callback for later lookup when the rendering is done. 261 // this callback for later lookup when the rendering is done.
262 static int sequence_num = 0; 262 static int sequence_num = 0;
263 sequence_num++; 263 sequence_num++;
264 scoped_ptr<TransportDIB> thumbnail_dib(TransportDIB::Create( 264 scoped_ptr<TransportDIB> thumbnail_dib(TransportDIB::Create(
265 desired_size.width() * desired_size.height() * 4, sequence_num)); 265 desired_size.width() * desired_size.height() * 4, sequence_num));
266 266
267 #if defined(OS_WIN) 267 #if defined(OS_WIN)
268 // Duplicate the handle to the DIB here because the renderer process does not 268 // Duplicate the handle to the DIB here because the renderer process does not
269 // have permission. The duplicated handle is owned by the renderer process, 269 // have permission. The duplicated handle is owned by the renderer process,
270 // which is responsible for closing it. 270 // which is responsible for closing it.
271 TransportDIB::Handle renderer_dib_handle = app::win::GetSectionForProcess( 271 TransportDIB::Handle renderer_dib_handle = chrome::GetSectionForProcess(
272 thumbnail_dib->handle(), 272 thumbnail_dib->handle(),
273 renderer->process()->GetHandle(), 273 renderer->process()->GetHandle(),
274 false); 274 false);
275 if (!renderer_dib_handle) { 275 if (!renderer_dib_handle) {
276 LOG(WARNING) << "Could not duplicate dib handle for renderer"; 276 LOG(WARNING) << "Could not duplicate dib handle for renderer";
277 delete callback; 277 delete callback;
278 return; 278 return;
279 } 279 }
280 #else 280 #else
281 TransportDIB::Handle renderer_dib_handle = thumbnail_dib->handle(); 281 TransportDIB::Handle renderer_dib_handle = thumbnail_dib->handle();
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 return false; 676 return false;
677 // Skip if we don't have to udpate the existing thumbnail. 677 // Skip if we don't have to udpate the existing thumbnail.
678 ThumbnailScore current_score; 678 ThumbnailScore current_score;
679 if (is_known && 679 if (is_known &&
680 top_sites->GetPageThumbnailScore(url, &current_score) && 680 top_sites->GetPageThumbnailScore(url, &current_score) &&
681 !current_score.ShouldConsiderUpdating()) 681 !current_score.ShouldConsiderUpdating())
682 return false; 682 return false;
683 683
684 return true; 684 return true;
685 } 685 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/browser_render_process_host.cc ('k') | chrome/browser/ui/browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698