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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 358 |
359 #if defined(OS_CHROMEOS) | 359 #if defined(OS_CHROMEOS) |
360 is_logged_in = chromeos::LoginState::Get()->IsUserLoggedIn(); | 360 is_logged_in = chromeos::LoginState::Get()->IsUserLoggedIn(); |
361 #endif | 361 #endif |
362 | 362 |
363 if (is_logged_in) { | 363 if (is_logged_in) { |
364 DownloadPrefs* download_prefs = DownloadPrefs::FromBrowserContext( | 364 DownloadPrefs* download_prefs = DownloadPrefs::FromBrowserContext( |
365 ash::Shell::GetInstance()->delegate()->GetCurrentBrowserContext()); | 365 ash::Shell::GetInstance()->delegate()->GetCurrentBrowserContext()); |
366 *directory = download_prefs->DownloadPath(); | 366 *directory = download_prefs->DownloadPath(); |
367 } else { | 367 } else { |
368 if (!file_util::GetTempDir(directory)) { | 368 if (!base::GetTempDir(directory)) { |
369 LOG(ERROR) << "Failed to find temporary directory."; | 369 LOG(ERROR) << "Failed to find temporary directory."; |
370 return false; | 370 return false; |
371 } | 371 } |
372 } | 372 } |
373 return true; | 373 return true; |
374 } | 374 } |
375 | 375 |
376 const int GetScreenshotNotificationTitle( | 376 const int GetScreenshotNotificationTitle( |
377 ScreenshotTakerObserver::Result screenshot_result) { | 377 ScreenshotTakerObserver::Result screenshot_result) { |
378 switch (screenshot_result) { | 378 switch (screenshot_result) { |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 } | 591 } |
592 | 592 |
593 void ScreenshotTaker::SetScreenshotBasenameForTest( | 593 void ScreenshotTaker::SetScreenshotBasenameForTest( |
594 const std::string& basename) { | 594 const std::string& basename) { |
595 screenshot_basename_for_test_ = basename; | 595 screenshot_basename_for_test_ = basename; |
596 } | 596 } |
597 | 597 |
598 void ScreenshotTaker::SetScreenshotProfileForTest(Profile* profile) { | 598 void ScreenshotTaker::SetScreenshotProfileForTest(Profile* profile) { |
599 profile_for_test_ = profile; | 599 profile_for_test_ = profile; |
600 } | 600 } |
OLD | NEW |