Chromium Code Reviews| Index: chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc |
| diff --git a/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc b/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc |
| index 7fa0ec816499ca64023b59d09c73501a845ba260..748e3e7c176fc7d726bd06b538d80287c7ddabe9 100644 |
| --- a/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc |
| +++ b/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/bind.h" |
| #include "base/bind_helpers.h" |
| +#include "base/files/file_util.h" |
| #include "base/memory/ptr_util.h" |
| #include "base/path_service.h" |
| #include "base/strings/string_util.h" |
| @@ -79,9 +80,12 @@ CupsPrintersHandler::CupsPrintersHandler(content::WebUI* webui) |
| : printer_discoverer_(nullptr), |
| profile_(Profile::FromWebUI(webui)), |
| weak_factory_(this) { |
| - base::FilePath ppd_cache_path; |
| - CHECK( |
| - base::PathService::Get(chrome::DIR_CHROMEOS_PPD_CACHE, &ppd_cache_path)); |
| + base::FilePath ppd_cache_path = profile_->GetPath().Append("PPDCache"); |
|
sky
2016/11/15 22:18:37
I think you need FILE_PATH_LITERAL here, or Append
Carlson
2016/11/15 22:25:12
It is chromeos-specific, but no harm in being orth
|
| + if (!base::PathExists(ppd_cache_path) && |
| + !base::CreateDirectory(ppd_cache_path)) { |
| + LOG(ERROR) << "Failed to create ppd cache directory " |
| + << ppd_cache_path.MaybeAsASCII(); |
| + } |
| ppd_provider_ = chromeos::printing::PpdProvider::Create( |
| google_apis::GetAPIKey(), g_browser_process->system_request_context(), |
| content::BrowserThread::GetTaskRunnerForThread( |