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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 const FilePath& local_path) { | 134 const FilePath& local_path) { |
135 if (error != gdata::DRIVE_FILE_OK) { | 135 if (error != gdata::DRIVE_FILE_OK) { |
136 LOG(ERROR) << "Failed to write screenshot image to Google Drive: " << error; | 136 LOG(ERROR) << "Failed to write screenshot image to Google Drive: " << error; |
137 return; | 137 return; |
138 } | 138 } |
139 SaveScreenshot(local_path, png_data); | 139 SaveScreenshot(local_path, png_data); |
140 } | 140 } |
141 | 141 |
142 void PostSaveScreenshotTask(const FilePath& screenshot_path, | 142 void PostSaveScreenshotTask(const FilePath& screenshot_path, |
143 scoped_refptr<base::RefCountedBytes> png_data) { | 143 scoped_refptr<base::RefCountedBytes> png_data) { |
144 if (gdata::util::IsUnderGDataMountPoint(screenshot_path)) { | 144 if (gdata::util::IsUnderDriveMountPoint(screenshot_path)) { |
145 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 145 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); |
146 if (profile) { | 146 if (profile) { |
147 gdata::util::PrepareWritableFileAndRun( | 147 gdata::util::PrepareWritableFileAndRun( |
148 profile, | 148 profile, |
149 screenshot_path, | 149 screenshot_path, |
150 base::Bind(&SaveScreenshotToGData, png_data)); | 150 base::Bind(&SaveScreenshotToGData, png_data)); |
151 } | 151 } |
152 } else { | 152 } else { |
153 content::BrowserThread::PostTask( | 153 content::BrowserThread::PostTask( |
154 content::BrowserThread::FILE, FROM_HERE, | 154 content::BrowserThread::FILE, FROM_HERE, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 ash::internal::kShellWindowId_OverlayContainer)->layer(); | 259 ash::internal::kShellWindowId_OverlayContainer)->layer(); |
260 parent->Add(visual_feedback_layer_.get()); | 260 parent->Add(visual_feedback_layer_.get()); |
261 visual_feedback_layer_->SetVisible(true); | 261 visual_feedback_layer_->SetVisible(true); |
262 | 262 |
263 MessageLoopForUI::current()->PostDelayedTask( | 263 MessageLoopForUI::current()->PostDelayedTask( |
264 FROM_HERE, | 264 FROM_HERE, |
265 base::Bind(&ScreenshotTaker::CloseVisualFeedbackLayer, | 265 base::Bind(&ScreenshotTaker::CloseVisualFeedbackLayer, |
266 base::Unretained(this)), | 266 base::Unretained(this)), |
267 base::TimeDelta::FromMilliseconds(kVisualFeedbackLayerDisplayTimeMs)); | 267 base::TimeDelta::FromMilliseconds(kVisualFeedbackLayerDisplayTimeMs)); |
268 } | 268 } |
OLD | NEW |