| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/screenshot_grabber.h" | 5 #include "ui/snapshot/screenshot_grabber.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <climits> | 9 #include <climits> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
| 15 #include "base/location.h" |
| 15 #include "base/logging.h" | 16 #include "base/logging.h" |
| 16 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 18 #include "base/single_thread_task_runner.h" |
| 17 #include "base/task_runner.h" | 19 #include "base/task_runner.h" |
| 18 #include "base/threading/sequenced_worker_pool.h" | 20 #include "base/threading/sequenced_worker_pool.h" |
| 21 #include "base/threading/thread_task_runner_handle.h" |
| 19 #include "base/time/time.h" | 22 #include "base/time/time.h" |
| 20 #include "ui/gfx/image/image.h" | 23 #include "ui/gfx/image/image.h" |
| 21 #include "ui/snapshot/snapshot.h" | 24 #include "ui/snapshot/snapshot.h" |
| 22 | 25 |
| 23 #if defined(USE_AURA) | 26 #if defined(USE_AURA) |
| 24 #include "ui/aura/window.h" | 27 #include "ui/aura/window.h" |
| 25 #endif | 28 #endif |
| 26 | 29 |
| 27 namespace ui { | 30 namespace ui { |
| 28 | 31 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 ScreenshotGrabberObserver::SCREENSHOT_GRABWINDOW_FULL_FAILED, | 188 ScreenshotGrabberObserver::SCREENSHOT_GRABWINDOW_FULL_FAILED, |
| 186 screenshot_path); | 189 screenshot_path); |
| 187 } | 190 } |
| 188 return; | 191 return; |
| 189 } | 192 } |
| 190 | 193 |
| 191 ShowNotificationCallback notification_callback(base::Bind( | 194 ShowNotificationCallback notification_callback(base::Bind( |
| 192 &ScreenshotGrabber::NotifyScreenshotCompleted, factory_.GetWeakPtr())); | 195 &ScreenshotGrabber::NotifyScreenshotCompleted, factory_.GetWeakPtr())); |
| 193 client_->PrepareFileAndRunOnBlockingPool( | 196 client_->PrepareFileAndRunOnBlockingPool( |
| 194 screenshot_path, blocking_task_runner_, | 197 screenshot_path, blocking_task_runner_, |
| 195 base::Bind(&SaveScreenshot, base::MessageLoop::current()->task_runner(), | 198 base::Bind(&SaveScreenshot, base::ThreadTaskRunnerHandle::Get(), |
| 196 notification_callback, screenshot_path, png_data)); | 199 notification_callback, screenshot_path, png_data)); |
| 197 } | 200 } |
| 198 | 201 |
| 199 } // namespace ui | 202 } // namespace ui |
| OLD | NEW |