summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_tabs_module.cc
diff options
context:
space:
mode:
authorrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 22:30:24 +0000
committerrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 22:30:24 +0000
commita7918784c2ac95844ae775be2fef06cd3efb092c (patch)
treeedc68878aa7929bae7b432cea8c488729b177de2 /chrome/browser/extensions/extension_tabs_module.cc
parent5624320887eb78e1d74268fdf0049ee7b58015d9 (diff)
downloadchromium_src-a7918784c2ac95844ae775be2fef06cd3efb092c.zip
chromium_src-a7918784c2ac95844ae775be2fef06cd3efb092c.tar.gz
chromium_src-a7918784c2ac95844ae775be2fef06cd3efb092c.tar.bz2
Implement chrome.tabs.getVisibleTabCapture() on Mac
Review URL: http://codereview.chromium.org/165429 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_tabs_module.cc')
-rw-r--r--chrome/browser/extensions/extension_tabs_module.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index 12b3547..4b3c9f3 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -640,7 +640,6 @@ bool CaptureVisibleTabFunction::RunImpl() {
}
SkBitmap screen_capture;
-#if defined(OS_WIN)
TabContents* tab_contents = browser->GetSelectedTabContents();
if (!tab_contents) {
error_ = keys::kInternalVisibleTabCaptureError;
@@ -652,6 +651,7 @@ bool CaptureVisibleTabFunction::RunImpl() {
error_ = keys::kInternalVisibleTabCaptureError;
return false;
}
+#if defined(OS_WIN)
skia::PlatformCanvas temp_canvas;
if (!temp_canvas.initialize(backing_store->size().width(),
backing_store->size().height(), true)) {
@@ -666,6 +666,9 @@ bool CaptureVisibleTabFunction::RunImpl() {
temp_canvas.endPlatformPaint();
screen_capture = temp_canvas.getTopPlatformDevice().accessBitmap(false);
+#elif defined(OS_MACOSX)
+ screen_capture = backing_store->canvas()->getTopPlatformDevice()
+ .accessBitmap(false);
#else
// TODO(port)
error_ = keys::kNotImplementedError;