| 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 "chrome/test/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 bool TakeRenderWidgetSnapshot(RenderWidgetHost* rwh, | 1193 bool TakeRenderWidgetSnapshot(RenderWidgetHost* rwh, |
| 1194 const gfx::Size& page_size, | 1194 const gfx::Size& page_size, |
| 1195 const gfx::Size& desired_size, | 1195 const gfx::Size& desired_size, |
| 1196 SkBitmap* bitmap) WARN_UNUSED_RESULT { | 1196 SkBitmap* bitmap) WARN_UNUSED_RESULT { |
| 1197 bitmap_ = bitmap; | 1197 bitmap_ = bitmap; |
| 1198 ThumbnailGenerator* generator = g_browser_process->GetThumbnailGenerator(); | 1198 ThumbnailGenerator* generator = g_browser_process->GetThumbnailGenerator(); |
| 1199 generator->MonitorRenderer(rwh, true); | 1199 generator->MonitorRenderer(rwh, true); |
| 1200 snapshot_taken_ = false; | 1200 snapshot_taken_ = false; |
| 1201 generator->AskForSnapshot( | 1201 generator->AskForSnapshot( |
| 1202 rwh, | 1202 rwh, |
| 1203 false, // don't use backing_store | |
| 1204 base::Bind(&SnapshotTaker::OnSnapshotTaken, base::Unretained(this)), | 1203 base::Bind(&SnapshotTaker::OnSnapshotTaken, base::Unretained(this)), |
| 1205 page_size, | 1204 page_size, |
| 1206 desired_size); | 1205 desired_size); |
| 1207 ui_test_utils::RunMessageLoop(); | 1206 ui_test_utils::RunMessageLoop(); |
| 1208 return snapshot_taken_; | 1207 return snapshot_taken_; |
| 1209 } | 1208 } |
| 1210 | 1209 |
| 1211 bool TakeEntirePageSnapshot(RenderViewHost* rvh, | 1210 bool TakeEntirePageSnapshot(RenderViewHost* rvh, |
| 1212 SkBitmap* bitmap) WARN_UNUSED_RESULT { | 1211 SkBitmap* bitmap) WARN_UNUSED_RESULT { |
| 1213 const wchar_t* script = | 1212 const wchar_t* script = |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 int state, | 1281 int state, |
| 1283 const base::Closure& followup) { | 1282 const base::Closure& followup) { |
| 1284 if (!followup.is_null()) | 1283 if (!followup.is_null()) |
| 1285 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); | 1284 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); |
| 1286 else | 1285 else |
| 1287 ui_controls::SendMouseEvents(button, state); | 1286 ui_controls::SendMouseEvents(button, state); |
| 1288 } | 1287 } |
| 1289 | 1288 |
| 1290 } // namespace internal | 1289 } // namespace internal |
| 1291 } // namespace ui_test_utils | 1290 } // namespace ui_test_utils |
| OLD | NEW |