| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 if (!file_util::CreateDirectory(screenshot_path.DirName())) { | 65 if (!file_util::CreateDirectory(screenshot_path.DirName())) { |
| 66 LOG(ERROR) << "Failed to ensure the existence of " | 66 LOG(ERROR) << "Failed to ensure the existence of " |
| 67 << screenshot_path.DirName().value(); | 67 << screenshot_path.DirName().value(); |
| 68 return; | 68 return; |
| 69 } | 69 } |
| 70 SaveScreenshotInternal(screenshot_path, png_data); | 70 SaveScreenshotInternal(screenshot_path, png_data); |
| 71 } | 71 } |
| 72 | 72 |
| 73 // TODO(kinaba): crbug.com/140425, remove this ungly #ifdef dispatch. | 73 // TODO(kinaba): crbug.com/140425, remove this ungly #ifdef dispatch. |
| 74 #ifdef OS_CHROMEOS | 74 #if defined(OS_CHROMEOS) |
| 75 void SaveScreenshotToDrive(scoped_refptr<base::RefCountedBytes> png_data, | 75 void SaveScreenshotToDrive(scoped_refptr<base::RefCountedBytes> png_data, |
| 76 drive::DriveFileError error, | 76 drive::DriveFileError error, |
| 77 const base::FilePath& local_path) { | 77 const base::FilePath& local_path) { |
| 78 if (error != drive::DRIVE_FILE_OK) { | 78 if (error != drive::DRIVE_FILE_OK) { |
| 79 LOG(ERROR) << "Failed to write screenshot image to Google Drive: " << error; | 79 LOG(ERROR) << "Failed to write screenshot image to Google Drive: " << error; |
| 80 return; | 80 return; |
| 81 } | 81 } |
| 82 SaveScreenshotInternal(local_path, png_data); | 82 SaveScreenshotInternal(local_path, png_data); |
| 83 } | 83 } |
| 84 | 84 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 ash::internal::kShellWindowId_OverlayContainer)->layer(); | 231 ash::internal::kShellWindowId_OverlayContainer)->layer(); |
| 232 parent->Add(visual_feedback_layer_.get()); | 232 parent->Add(visual_feedback_layer_.get()); |
| 233 visual_feedback_layer_->SetVisible(true); | 233 visual_feedback_layer_->SetVisible(true); |
| 234 | 234 |
| 235 MessageLoopForUI::current()->PostDelayedTask( | 235 MessageLoopForUI::current()->PostDelayedTask( |
| 236 FROM_HERE, | 236 FROM_HERE, |
| 237 base::Bind(&ScreenshotTaker::CloseVisualFeedbackLayer, | 237 base::Bind(&ScreenshotTaker::CloseVisualFeedbackLayer, |
| 238 base::Unretained(this)), | 238 base::Unretained(this)), |
| 239 base::TimeDelta::FromMilliseconds(kVisualFeedbackLayerDisplayTimeMs)); | 239 base::TimeDelta::FromMilliseconds(kVisualFeedbackLayerDisplayTimeMs)); |
| 240 } | 240 } |
| OLD | NEW |