| 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/browser/ui/ash/screenshot_taker.h" | 5 #include "chrome/browser/ui/ash/screenshot_taker.h" |
| 6 | 6 |
| 7 #include <climits> | 7 #include <climits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 | 545 |
| 546 bool ScreenshotTaker::HasObserver(ScreenshotTakerObserver* observer) const { | 546 bool ScreenshotTaker::HasObserver(ScreenshotTakerObserver* observer) const { |
| 547 return observers_.HasObserver(observer); | 547 return observers_.HasObserver(observer); |
| 548 } | 548 } |
| 549 | 549 |
| 550 void ScreenshotTaker::GrabWindowSnapshotAsyncCallback( | 550 void ScreenshotTaker::GrabWindowSnapshotAsyncCallback( |
| 551 base::FilePath screenshot_path, | 551 base::FilePath screenshot_path, |
| 552 bool is_partial, | 552 bool is_partial, |
| 553 int window_idx, | 553 int window_idx, |
| 554 scoped_refptr<base::RefCountedBytes> png_data) { | 554 scoped_refptr<base::RefCountedBytes> png_data) { |
| 555 if (!png_data) { | 555 if (!png_data.get()) { |
| 556 if (is_partial) { | 556 if (is_partial) { |
| 557 LOG(ERROR) << "Failed to grab the window screenshot"; | 557 LOG(ERROR) << "Failed to grab the window screenshot"; |
| 558 ShowNotification( | 558 ShowNotification( |
| 559 ScreenshotTakerObserver::SCREENSHOT_GRABWINDOW_PARTIAL_FAILED, | 559 ScreenshotTakerObserver::SCREENSHOT_GRABWINDOW_PARTIAL_FAILED, |
| 560 screenshot_path); | 560 screenshot_path); |
| 561 } else { | 561 } else { |
| 562 LOG(ERROR) << "Failed to grab the window screenshot for " << window_idx; | 562 LOG(ERROR) << "Failed to grab the window screenshot for " << window_idx; |
| 563 ShowNotification( | 563 ShowNotification( |
| 564 ScreenshotTakerObserver::SCREENSHOT_GRABWINDOW_FULL_FAILED, | 564 ScreenshotTakerObserver::SCREENSHOT_GRABWINDOW_FULL_FAILED, |
| 565 screenshot_path); | 565 screenshot_path); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 } | 626 } |
| 627 | 627 |
| 628 void ScreenshotTaker::SetScreenshotBasenameForTest( | 628 void ScreenshotTaker::SetScreenshotBasenameForTest( |
| 629 const std::string& basename) { | 629 const std::string& basename) { |
| 630 screenshot_basename_for_test_ = basename; | 630 screenshot_basename_for_test_ = basename; |
| 631 } | 631 } |
| 632 | 632 |
| 633 void ScreenshotTaker::SetScreenshotProfileForTest(Profile* profile) { | 633 void ScreenshotTaker::SetScreenshotProfileForTest(Profile* profile) { |
| 634 profile_for_test_ = profile; | 634 profile_for_test_ = profile; |
| 635 } | 635 } |
| OLD | NEW |