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

Side by Side Diff: chrome/browser/aeropeek_manager.cc

Issue 9600036: Move Render(View|Widget)Host and associated classes to content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. Created 8 years, 9 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) 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/aeropeek_manager.h" 5 #include "chrome/browser/aeropeek_manager.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <shobjidl.h> 8 #include <shobjidl.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 984
985 bool AeroPeekManager::GetTabPreview(int tab_id, SkBitmap* preview) { 985 bool AeroPeekManager::GetTabPreview(int tab_id, SkBitmap* preview) {
986 DCHECK(preview); 986 DCHECK(preview);
987 987
988 // Retrieve the BackingStore associated with the given tab and return its 988 // Retrieve the BackingStore associated with the given tab and return its
989 // SkPlatformCanvas. 989 // SkPlatformCanvas.
990 WebContents* contents = GetWebContents(tab_id); 990 WebContents* contents = GetWebContents(tab_id);
991 if (!contents) 991 if (!contents)
992 return false; 992 return false;
993 993
994 RenderViewHost* render_view_host = contents->GetRenderViewHost(); 994 content::RenderViewHost* render_view_host = contents->GetRenderViewHost();
995 if (!render_view_host) 995 if (!render_view_host)
996 return false; 996 return false;
997 997
998 // Create a copy of this BackingStore image. 998 // Create a copy of this BackingStore image.
999 // This code is just copied from "thumbnail_generator.cc". 999 // This code is just copied from "thumbnail_generator.cc".
1000 skia::PlatformCanvas canvas; 1000 skia::PlatformCanvas canvas;
1001 if (!render_view_host->CopyFromBackingStore(&canvas)) 1001 if (!render_view_host->CopyFromBackingStore(&canvas))
1002 return false; 1002 return false;
1003 1003
1004 const SkBitmap& bitmap = skia::GetTopDevice(canvas)->accessBitmap(false); 1004 const SkBitmap& bitmap = skia::GetTopDevice(canvas)->accessBitmap(false);
1005 bitmap.copyTo(preview, SkBitmap::kARGB_8888_Config); 1005 bitmap.copyTo(preview, SkBitmap::kARGB_8888_Config);
1006 return true; 1006 return true;
1007 } 1007 }
OLDNEW
« no previous file with comments | « chrome/browser/accessibility/accessibility_win_browsertest.cc ('k') | chrome/browser/autocomplete/autocomplete_edit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698