OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/download/download_dir_policy_handler.h" | 5 #include "chrome/browser/download/download_dir_policy_handler.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/prefs/pref_value_map.h" | 9 #include "base/prefs/pref_value_map.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 base::FilePath::StringType expanded_value = | 31 base::FilePath::StringType expanded_value = |
32 policy::path_parser::ExpandPathVariables(string_value); | 32 policy::path_parser::ExpandPathVariables(string_value); |
33 // Make sure the path isn't empty, since that will point to an undefined | 33 // Make sure the path isn't empty, since that will point to an undefined |
34 // location; the default location is used instead in that case. | 34 // location; the default location is used instead in that case. |
35 // This is checked after path expansion because a non-empty policy value can | 35 // This is checked after path expansion because a non-empty policy value can |
36 // lead to an empty path value after expansion (e.g. "\"\""). | 36 // lead to an empty path value after expansion (e.g. "\"\""). |
37 if (expanded_value.empty()) | 37 if (expanded_value.empty()) |
38 expanded_value = DownloadPrefs::GetDefaultDownloadDirectory().value(); | 38 expanded_value = DownloadPrefs::GetDefaultDownloadDirectory().value(); |
39 prefs->SetValue(prefs::kDownloadDefaultDirectory, | 39 prefs->SetValue(prefs::kDownloadDefaultDirectory, |
40 Value::CreateStringValue(expanded_value)); | 40 base::Value::CreateStringValue(expanded_value)); |
41 prefs->SetValue(prefs::kPromptForDownload, | 41 prefs->SetValue(prefs::kPromptForDownload, |
42 Value::CreateBooleanValue(false)); | 42 base::Value::CreateBooleanValue(false)); |
43 } | 43 } |
OLD | NEW |