| OLD | NEW |
| 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 "ui/snapshot/snapshot.h" | 5 #include "ui/snapshot/snapshot.h" |
| 6 | 6 |
| 7 #include <gdk/gdkx.h> | 7 #include <gdk/gdkx.h> |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "ui/base/x/x11_util.h" | 12 #include "ui/base/x/x11_util.h" |
| 13 #include "ui/gfx/image/image.h" |
| 13 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 cairo_status_t SnapshotCallback(void* closure, | 18 cairo_status_t SnapshotCallback(void* closure, |
| 18 const unsigned char* data, | 19 const unsigned char* data, |
| 19 unsigned int length) { | 20 unsigned int length) { |
| 20 std::vector<unsigned char>* png_representation = | 21 std::vector<unsigned char>* png_representation = |
| 21 static_cast<std::vector<unsigned char>*>(closure); | 22 static_cast<std::vector<unsigned char>*>(closure); |
| 22 | 23 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 return GrabViewSnapshot(GTK_WIDGET(window_handle), png_representation, | 83 return GrabViewSnapshot(GTK_WIDGET(window_handle), png_representation, |
| 83 snapshot_bounds); | 84 snapshot_bounds); |
| 84 } | 85 } |
| 85 | 86 |
| 86 void GrabWindowSnapshotAndScaleAsync( | 87 void GrabWindowSnapshotAndScaleAsync( |
| 87 gfx::NativeWindow window, | 88 gfx::NativeWindow window, |
| 88 const gfx::Rect& snapshot_bounds, | 89 const gfx::Rect& snapshot_bounds, |
| 89 const gfx::Size& target_size, | 90 const gfx::Size& target_size, |
| 90 scoped_refptr<base::TaskRunner> background_task_runner, | 91 scoped_refptr<base::TaskRunner> background_task_runner, |
| 91 GrabWindowSnapshotAsyncCallback callback) { | 92 GrabWindowSnapshotAsyncCallback callback) { |
| 92 NOTIMPLEMENTED(); | 93 callback.Run(gfx::Image()); |
| 94 } |
| 95 |
| 96 void GrabViewSnapshotAsync( |
| 97 gfx::NativeView view, |
| 98 const gfx::Rect& source_rect, |
| 99 scoped_refptr<base::TaskRunner> background_task_runner, |
| 100 const GrabWindowSnapshotAsyncPNGCallback& callback) { |
| 101 callback.Run(scoped_refptr<base::RefCountedBytes>()); |
| 93 } | 102 } |
| 94 | 103 |
| 95 void GrabWindowSnapshotAsync( | 104 void GrabWindowSnapshotAsync( |
| 96 gfx::NativeWindow window, | 105 gfx::NativeWindow window, |
| 97 const gfx::Rect& source_rect, | 106 const gfx::Rect& source_rect, |
| 98 scoped_refptr<base::TaskRunner> background_task_runner, | 107 scoped_refptr<base::TaskRunner> background_task_runner, |
| 99 const GrabWindowSnapshotAsyncPNGCallback& callback) { | 108 const GrabWindowSnapshotAsyncPNGCallback& callback) { |
| 100 NOTIMPLEMENTED(); | 109 callback.Run(scoped_refptr<base::RefCountedBytes>()); |
| 101 } | 110 } |
| 102 | 111 |
| 103 } // namespace ui | 112 } // namespace ui |
| OLD | NEW |