Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Unified Diff: chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc

Issue 2504763002: Change PPDCache to use a path inside the per-user profile. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/chrome_paths.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | chrome/common/chrome_paths.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698