| 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 "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "ui/base/android/view_android.h" | 8 #include "ui/base/android/view_android.h" |
| 9 #include "ui/base/android/window_android.h" | 9 #include "ui/base/android/window_android.h" |
| 10 #include "ui/gfx/display.h" | 10 #include "ui/gfx/display.h" |
| 11 #include "ui/gfx/image/image.h" |
| 11 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
| 12 #include "ui/gfx/screen.h" | 13 #include "ui/gfx/screen.h" |
| 13 | 14 |
| 14 namespace ui { | 15 namespace ui { |
| 15 | 16 |
| 16 bool GrabViewSnapshot(gfx::NativeView view, | 17 bool GrabViewSnapshot(gfx::NativeView view, |
| 17 std::vector<unsigned char>* png_representation, | 18 std::vector<unsigned char>* png_representation, |
| 18 const gfx::Rect& snapshot_bounds) { | 19 const gfx::Rect& snapshot_bounds) { |
| 19 return GrabWindowSnapshot( | 20 return GrabWindowSnapshot( |
| 20 view->GetWindowAndroid(), png_representation, snapshot_bounds); | 21 view->GetWindowAndroid(), png_representation, snapshot_bounds); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 32 scaled_bounds.x(), scaled_bounds.y(), scaled_bounds.width(), | 33 scaled_bounds.x(), scaled_bounds.y(), scaled_bounds.width(), |
| 33 scaled_bounds.height(), png_representation); | 34 scaled_bounds.height(), png_representation); |
| 34 } | 35 } |
| 35 | 36 |
| 36 void GrabWindowSnapshotAndScaleAsync( | 37 void GrabWindowSnapshotAndScaleAsync( |
| 37 gfx::NativeWindow window, | 38 gfx::NativeWindow window, |
| 38 const gfx::Rect& snapshot_bounds, | 39 const gfx::Rect& snapshot_bounds, |
| 39 const gfx::Size& target_size, | 40 const gfx::Size& target_size, |
| 40 scoped_refptr<base::TaskRunner> background_task_runner, | 41 scoped_refptr<base::TaskRunner> background_task_runner, |
| 41 GrabWindowSnapshotAsyncCallback callback) { | 42 GrabWindowSnapshotAsyncCallback callback) { |
| 42 NOTIMPLEMENTED(); | 43 callback.Run(gfx::Image()); |
| 44 } |
| 45 |
| 46 void GrabViewSnapshotAsync( |
| 47 gfx::NativeView view, |
| 48 const gfx::Rect& source_rect, |
| 49 scoped_refptr<base::TaskRunner> background_task_runner, |
| 50 const GrabWindowSnapshotAsyncPNGCallback& callback) { |
| 51 callback.Run(scoped_refptr<base::RefCountedBytes>()); |
| 43 } | 52 } |
| 44 | 53 |
| 45 void GrabWindowSnapshotAsync( | 54 void GrabWindowSnapshotAsync( |
| 46 gfx::NativeWindow window, | 55 gfx::NativeWindow window, |
| 47 const gfx::Rect& source_rect, | 56 const gfx::Rect& source_rect, |
| 48 scoped_refptr<base::TaskRunner> background_task_runner, | 57 scoped_refptr<base::TaskRunner> background_task_runner, |
| 49 const GrabWindowSnapshotAsyncPNGCallback& callback) { | 58 const GrabWindowSnapshotAsyncPNGCallback& callback) { |
| 50 NOTIMPLEMENTED(); | 59 callback.Run(scoped_refptr<base::RefCountedBytes>()); |
| 51 } | 60 } |
| 52 | 61 |
| 53 } // namespace ui | 62 } // namespace ui |
| OLD | NEW |