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

Unified Diff: base/mac/mac_util.mm

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, 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 | « base/mac/mac_util.h ('k') | base/mac/mac_util_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/mac_util.mm
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm
index c32be37c63452cd8341a8641efeb983ac93c6fb2..7f3be186daa8c0da82e4b5d58f21b1d70f27d756 100644
--- a/base/mac/mac_util.mm
+++ b/base/mac/mac_util.mm
@@ -9,7 +9,6 @@
#include "base/file_path.h"
#include "base/logging.h"
#include "base/mac/scoped_cftyperef.h"
-#include "base/message_loop.h"
#include "base/scoped_nsobject.h"
#include "base/sys_string_conversions.h"
@@ -229,36 +228,6 @@ bool ShouldWindowsMiniaturizeOnDoubleClick() {
[NSWindow performSelector:@selector(_shouldMiniaturizeOnDoubleClick)];
}
-void GrabWindowSnapshot(NSWindow* window,
- std::vector<unsigned char>* png_representation,
- int* width, int* height) {
- png_representation->clear();
- *width = 0;
- *height = 0;
-
- // Make sure to grab the "window frame" view so we get current tab +
- // tabstrip.
- NSView* view = [[window contentView] superview];
- ScopedCFTypeRef<CGImageRef> windowSnapshot(CGWindowListCreateImage(
- CGRectNull, kCGWindowListOptionIncludingWindow,
- [[view window] windowNumber], kCGWindowImageBoundsIgnoreFraming));
- if (CGImageGetWidth(windowSnapshot) <= 0)
- return;
-
- scoped_nsobject<NSBitmapImageRep> rep(
- [[NSBitmapImageRep alloc] initWithCGImage:windowSnapshot]);
- NSData* data = [rep representationUsingType:NSPNGFileType properties:nil];
- const unsigned char* buf = static_cast<const unsigned char*>([data bytes]);
- NSUInteger length = [data length];
- if (buf == NULL || length == 0)
- return;
-
- *width = static_cast<int>([rep pixelsWide]);
- *height = static_cast<int>([rep pixelsHigh]);
- png_representation->assign(buf, buf + length);
- DCHECK(png_representation->size() > 0);
-}
-
void ActivateProcess(pid_t pid) {
ProcessSerialNumber process;
OSStatus status = GetProcessForPID(pid, &process);
« no previous file with comments | « base/mac/mac_util.h ('k') | base/mac/mac_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698