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/browser/chromeos/gdata/gdata_util.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 const FilePath& path) { | 240 const FilePath& path) { |
241 std::vector<std::pair<FilePath, int> > cache_paths; | 241 std::vector<std::pair<FilePath, int> > cache_paths; |
242 InsertGDataCachePathsPermissions(profile, path, &cache_paths); | 242 InsertGDataCachePathsPermissions(profile, path, &cache_paths); |
243 for (size_t i = 0; i < cache_paths.size(); i++) { | 243 for (size_t i = 0; i < cache_paths.size(); i++) { |
244 content::ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( | 244 content::ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( |
245 pid, cache_paths[i].first, cache_paths[i].second); | 245 pid, cache_paths[i].first, cache_paths[i].second); |
246 } | 246 } |
247 } | 247 } |
248 | 248 |
249 bool IsGDataAvailable(Profile* profile) { | 249 bool IsGDataAvailable(Profile* profile) { |
250 // We allow GData only in canary and dev channels. http://crosbug.com/28806 | |
251 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | |
252 if (channel == chrome::VersionInfo::CHANNEL_DEV || | |
253 channel == chrome::VersionInfo::CHANNEL_BETA || | |
254 channel == chrome::VersionInfo::CHANNEL_STABLE) | |
255 return false; | |
256 | |
257 // Do not allow GData for incognito windows / guest mode. | 250 // Do not allow GData for incognito windows / guest mode. |
258 if (profile->IsOffTheRecord()) | 251 if (profile->IsOffTheRecord()) |
259 return false; | 252 return false; |
260 | 253 |
261 // Disable gdata if preference is set. This can happen with commandline flag | 254 // Disable gdata if preference is set. This can happen with commandline flag |
262 // --disable-gdata or enterprise policy, or probably with user settings too | 255 // --disable-gdata or enterprise policy, or probably with user settings too |
263 // in the future. | 256 // in the future. |
264 if (profile->GetPrefs()->GetBoolean(prefs::kDisableGData)) | 257 if (profile->GetPrefs()->GetBoolean(prefs::kDisableGData)) |
265 return false; | 258 return false; |
266 | 259 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 // Assign the extracted extensions to md5 and extra_extension. | 318 // Assign the extracted extensions to md5 and extra_extension. |
326 int extension_count = extensions.size(); | 319 int extension_count = extensions.size(); |
327 *md5 = (extension_count > 0) ? extensions[extension_count - 1] : | 320 *md5 = (extension_count > 0) ? extensions[extension_count - 1] : |
328 std::string(); | 321 std::string(); |
329 *extra_extension = (extension_count > 1) ? extensions[extension_count - 2] : | 322 *extra_extension = (extension_count > 1) ? extensions[extension_count - 2] : |
330 std::string(); | 323 std::string(); |
331 } | 324 } |
332 | 325 |
333 } // namespace util | 326 } // namespace util |
334 } // namespace gdata | 327 } // namespace gdata |
OLD | NEW |