summaryrefslogtreecommitdiffstats
path: root/cloud_print
diff options
context:
space:
mode:
authorcpu <cpu@chromium.org>2014-10-27 16:14:05 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-27 23:14:50 +0000
commit1b29da2e5a43c42752b8bf489880a82eaf04b930 (patch)
tree15e770f027b30be98da17c794b1ff8892ff87440 /cloud_print
parent7e150a9045108133f5515342f1da6fcc3c23eff8 (diff)
downloadchromium_src-1b29da2e5a43c42752b8bf489880a82eaf04b930.zip
chromium_src-1b29da2e5a43c42752b8bf489880a82eaf04b930.tar.gz
chromium_src-1b29da2e5a43c42752b8bf489880a82eaf04b930.tar.bz2
remove DIR_LOCAL_APP_DATA_LOW from base.
Not used except for cloud print. BUG=426573 TBR=rvargas Review URL: https://codereview.chromium.org/681533002 Cr-Commit-Position: refs/heads/master@{#301473}
Diffstat (limited to 'cloud_print')
-rw-r--r--cloud_print/virtual_driver/win/port_monitor/port_monitor.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
index 26f7b3f..28c4a3b 100644
--- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
+++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
@@ -106,14 +106,22 @@ MONITOR2 g_monitor_2 = {
Monitor2Shutdown
};
+base::FilePath GetLocalAppDataLow() {
+ wchar_t system_buffer[MAX_PATH];
+ if (FAILED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT,
+ system_buffer)))
+ return base::FilePath();
+ return base::FilePath(system_buffer).DirName().AppendASCII("LocalLow");
+}
+
base::FilePath GetAppDataDir() {
base::FilePath file_path;
- base::win::Version version = base::win::GetVersion();
- int path_id = (version >= base::win::VERSION_VISTA) ?
- base::DIR_LOCAL_APP_DATA_LOW : base::DIR_LOCAL_APP_DATA;
- if (!PathService::Get(path_id, &file_path)) {
- LOG(ERROR) << "Can't get DIR_LOCAL_APP_DATA";
- return base::FilePath();
+ if (base::win::GetVersion() >= base::win::VERSION_VISTA)
+ file_path = GetLocalAppDataLow();
+ else
+ PathService::Get(base::DIR_LOCAL_APP_DATA, &file_path);
+ if (file_path.empty()) {
+ LOG(ERROR) << "Can't get app data dir";
}
return file_path.Append(kAppDataDir);
}