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 "chrome/browser/ui/ash/chrome_screenshot_grabber.h" | 5 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/strings/grit/ash_strings.h" | 10 #include "ash/strings/grit/ash_strings.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 274 |
275 return file_name; | 275 return file_name; |
276 } | 276 } |
277 | 277 |
278 } // namespace | 278 } // namespace |
279 | 279 |
280 ChromeScreenshotGrabber::ChromeScreenshotGrabber() | 280 ChromeScreenshotGrabber::ChromeScreenshotGrabber() |
281 : screenshot_grabber_(new ui::ScreenshotGrabber( | 281 : screenshot_grabber_(new ui::ScreenshotGrabber( |
282 this, | 282 this, |
283 base::CreateTaskRunnerWithTraits( | 283 base::CreateTaskRunnerWithTraits( |
284 base::TaskTraits() | 284 {base::MayBlock(), base::TaskPriority::USER_VISIBLE, |
285 .MayBlock() | 285 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}))), |
286 .WithPriority(base::TaskPriority::USER_VISIBLE) | |
287 .WithShutdownBehavior( | |
288 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN)))), | |
289 profile_for_test_(NULL) { | 286 profile_for_test_(NULL) { |
290 screenshot_grabber_->AddObserver(this); | 287 screenshot_grabber_->AddObserver(this); |
291 } | 288 } |
292 | 289 |
293 ChromeScreenshotGrabber::~ChromeScreenshotGrabber() { | 290 ChromeScreenshotGrabber::~ChromeScreenshotGrabber() { |
294 screenshot_grabber_->RemoveObserver(this); | 291 screenshot_grabber_->RemoveObserver(this); |
295 } | 292 } |
296 | 293 |
297 void ChromeScreenshotGrabber::HandleTakeScreenshotForAllRootWindows() { | 294 void ChromeScreenshotGrabber::HandleTakeScreenshotForAllRootWindows() { |
298 if (ScreenshotsDisabled()) { | 295 if (ScreenshotsDisabled()) { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 } | 465 } |
469 | 466 |
470 void ChromeScreenshotGrabber::SetProfileForTest(Profile* profile) { | 467 void ChromeScreenshotGrabber::SetProfileForTest(Profile* profile) { |
471 profile_for_test_ = profile; | 468 profile_for_test_ = profile; |
472 } | 469 } |
473 | 470 |
474 Profile* ChromeScreenshotGrabber::GetProfile() { | 471 Profile* ChromeScreenshotGrabber::GetProfile() { |
475 return profile_for_test_ ? profile_for_test_ | 472 return profile_for_test_ ? profile_for_test_ |
476 : ProfileManager::GetActiveUserProfile(); | 473 : ProfileManager::GetActiveUserProfile(); |
477 } | 474 } |
OLD | NEW |