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/common/chrome_paths_internal.h" | 5 #include "chrome/common/chrome_paths_internal.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <knownfolders.h> | 8 #include <knownfolders.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 | 125 |
126 bool GetUserPicturesDirectory(FilePath* result) { | 126 bool GetUserPicturesDirectory(FilePath* result) { |
127 return GetUserDirectory(CSIDL_MYPICTURES, result); | 127 return GetUserDirectory(CSIDL_MYPICTURES, result); |
128 } | 128 } |
129 | 129 |
130 bool GetUserVideosDirectory(FilePath* result) { | 130 bool GetUserVideosDirectory(FilePath* result) { |
131 return GetUserDirectory(CSIDL_MYVIDEO, result); | 131 return GetUserDirectory(CSIDL_MYVIDEO, result); |
132 } | 132 } |
133 | 133 |
134 bool GetUserDesktop(FilePath* result) { | |
135 return GetUserDirectory(CSIDL_DESKTOPDIRECTORY, result); | |
136 } | |
137 | |
138 bool ProcessNeedsProfileDir(const std::string& process_type) { | 134 bool ProcessNeedsProfileDir(const std::string& process_type) { |
139 // On windows we don't want subprocesses other than the browser process and | 135 // On windows we don't want subprocesses other than the browser process and |
140 // service processes to be able to use the profile directory because if it | 136 // service processes to be able to use the profile directory because if it |
141 // lies on a network share the sandbox will prevent us from accessing it. | 137 // lies on a network share the sandbox will prevent us from accessing it. |
142 // TODO(pastarmovj): For now gpu and plugin broker processes are whitelisted | 138 // TODO(pastarmovj): For now gpu and plugin broker processes are whitelisted |
143 // too because they do use the profile dir in some way but this must be | 139 // too because they do use the profile dir in some way but this must be |
144 // investigated and fixed if possible. | 140 // investigated and fixed if possible. |
145 return process_type.empty() || | 141 return process_type.empty() || |
146 process_type == switches::kServiceProcess || | 142 process_type == switches::kServiceProcess || |
147 process_type == switches::kGpuProcess || | 143 process_type == switches::kGpuProcess || |
148 process_type == switches::kNaClBrokerProcess || | 144 process_type == switches::kNaClBrokerProcess || |
149 process_type == switches::kNaClLoaderProcess || | 145 process_type == switches::kNaClLoaderProcess || |
150 process_type == switches::kPpapiBrokerProcess; | 146 process_type == switches::kPpapiBrokerProcess; |
151 } | 147 } |
152 | 148 |
153 } // namespace chrome | 149 } // namespace chrome |
OLD | NEW |