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