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/auto_start_linux.h" | 5 #include "chrome/common/auto_start_linux.h" |
6 | 6 |
7 #include "base/environment.h" | 7 #include "base/environment.h" |
8 #include "base/file_util.h" | |
9 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/nix/xdg_util.h" | 11 #include "base/nix/xdg_util.h" |
12 #include "base/strings/string_tokenizer.h" | 12 #include "base/strings/string_tokenizer.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 const base::FilePath::CharType kAutostart[] = "autostart"; | 16 const base::FilePath::CharType kAutostart[] = "autostart"; |
17 | 17 |
18 base::FilePath GetAutostartDirectory(base::Environment* environment) { | 18 base::FilePath GetAutostartDirectory(base::Environment* environment) { |
19 base::FilePath result = base::nix::GetXDGDirectory( | 19 base::FilePath result = base::nix::GetXDGDirectory( |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 base::StringTokenizer tokenizer(contents, "\n"); | 82 base::StringTokenizer tokenizer(contents, "\n"); |
83 std::string token = value_name + "="; | 83 std::string token = value_name + "="; |
84 while (tokenizer.GetNext()) { | 84 while (tokenizer.GetNext()) { |
85 if (tokenizer.token().substr(0, token.length()) == token) { | 85 if (tokenizer.token().substr(0, token.length()) == token) { |
86 *value = tokenizer.token().substr(token.length()); | 86 *value = tokenizer.token().substr(token.length()); |
87 return true; | 87 return true; |
88 } | 88 } |
89 } | 89 } |
90 return false; | 90 return false; |
91 } | 91 } |
OLD | NEW |