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> |
11 #include <shobjidl.h> | 11 #include <shobjidl.h> |
12 | 12 |
| 13 #include "base/base_paths_win.h" |
13 #include "base/command_line.h" | 14 #include "base/command_line.h" |
14 #include "base/file_path.h" | 15 #include "base/file_path.h" |
15 #include "base/path_service.h" | 16 #include "base/path_service.h" |
16 #include "base/win/metro.h" | 17 #include "base/win/metro.h" |
17 #include "base/win/scoped_co_mem.h" | 18 #include "base/win/scoped_co_mem.h" |
18 #include "chrome/common/chrome_constants.h" | 19 #include "chrome/common/chrome_constants.h" |
19 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
20 #include "chrome/installer/util/browser_distribution.h" | 21 #include "chrome/installer/util/browser_distribution.h" |
21 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
22 | 23 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 125 } |
125 | 126 |
126 bool GetUserPicturesDirectory(FilePath* result) { | 127 bool GetUserPicturesDirectory(FilePath* result) { |
127 return GetUserDirectory(CSIDL_MYPICTURES, result); | 128 return GetUserDirectory(CSIDL_MYPICTURES, result); |
128 } | 129 } |
129 | 130 |
130 bool GetUserVideosDirectory(FilePath* result) { | 131 bool GetUserVideosDirectory(FilePath* result) { |
131 return GetUserDirectory(CSIDL_MYVIDEO, result); | 132 return GetUserDirectory(CSIDL_MYVIDEO, result); |
132 } | 133 } |
133 | 134 |
134 bool GetUserDesktop(FilePath* result) { | |
135 return GetUserDirectory(CSIDL_DESKTOPDIRECTORY, result); | |
136 } | |
137 | |
138 bool ProcessNeedsProfileDir(const std::string& process_type) { | 135 bool ProcessNeedsProfileDir(const std::string& process_type) { |
139 // On windows we don't want subprocesses other than the browser process and | 136 // 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 | 137 // 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. | 138 // 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 | 139 // 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 | 140 // too because they do use the profile dir in some way but this must be |
144 // investigated and fixed if possible. | 141 // investigated and fixed if possible. |
145 return process_type.empty() || | 142 return process_type.empty() || |
146 process_type == switches::kServiceProcess || | 143 process_type == switches::kServiceProcess || |
147 process_type == switches::kGpuProcess || | 144 process_type == switches::kGpuProcess || |
148 process_type == switches::kNaClBrokerProcess || | 145 process_type == switches::kNaClBrokerProcess || |
149 process_type == switches::kNaClLoaderProcess || | 146 process_type == switches::kNaClLoaderProcess || |
150 process_type == switches::kPpapiBrokerProcess; | 147 process_type == switches::kPpapiBrokerProcess; |
151 } | 148 } |
152 | 149 |
153 } // namespace chrome | 150 } // namespace chrome |
OLD | NEW |