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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 bool is_logged_in = true; | 147 bool is_logged_in = true; |
148 #if defined(OS_CHROMEOS) | 148 #if defined(OS_CHROMEOS) |
149 is_logged_in = chromeos::UserManager::Get()->IsUserLoggedIn(); | 149 is_logged_in = chromeos::UserManager::Get()->IsUserLoggedIn(); |
150 #endif | 150 #endif |
151 | 151 |
152 FilePath screenshot_directory; | 152 FilePath screenshot_directory; |
153 if (is_logged_in) { | 153 if (is_logged_in) { |
154 DownloadPrefs* download_prefs = DownloadPrefs::FromBrowserContext( | 154 DownloadPrefs* download_prefs = DownloadPrefs::FromBrowserContext( |
155 ash::Shell::GetInstance()->delegate()->GetCurrentBrowserContext()); | 155 ash::Shell::GetInstance()->delegate()->GetCurrentBrowserContext()); |
156 screenshot_directory = download_prefs->download_path(); | 156 screenshot_directory = download_prefs->DownloadPath(); |
157 } else { | 157 } else { |
158 if (!file_util::GetTempDir(&screenshot_directory)) { | 158 if (!file_util::GetTempDir(&screenshot_directory)) { |
159 LOG(ERROR) << "Failed to find temporary directory."; | 159 LOG(ERROR) << "Failed to find temporary directory."; |
160 return; | 160 return; |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 bool use_24hour_clock = ShouldUse24HourClock(); | 164 bool use_24hour_clock = ShouldUse24HourClock(); |
165 | 165 |
166 if (GrabWindowSnapshot(window, rect, &png_data->data())) { | 166 if (GrabWindowSnapshot(window, rect, &png_data->data())) { |
(...skipping 26 matching lines...) Expand all Loading... |
193 ash::internal::kShellWindowId_OverlayContainer)->layer(); | 193 ash::internal::kShellWindowId_OverlayContainer)->layer(); |
194 parent->Add(visual_feedback_layer_.get()); | 194 parent->Add(visual_feedback_layer_.get()); |
195 visual_feedback_layer_->SetVisible(true); | 195 visual_feedback_layer_->SetVisible(true); |
196 | 196 |
197 MessageLoopForUI::current()->PostDelayedTask( | 197 MessageLoopForUI::current()->PostDelayedTask( |
198 FROM_HERE, | 198 FROM_HERE, |
199 base::Bind(&ScreenshotTaker::CloseVisualFeedbackLayer, | 199 base::Bind(&ScreenshotTaker::CloseVisualFeedbackLayer, |
200 base::Unretained(this)), | 200 base::Unretained(this)), |
201 base::TimeDelta::FromMilliseconds(kVisualFeedbackLayerDisplayTimeMs)); | 201 base::TimeDelta::FromMilliseconds(kVisualFeedbackLayerDisplayTimeMs)); |
202 } | 202 } |
OLD | NEW |