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/extensions/platform_app_launcher.h" | 5 #include "chrome/browser/extensions/platform_app_launcher.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 namespace extensions { | 55 namespace extensions { |
56 | 56 |
57 namespace { | 57 namespace { |
58 | 58 |
59 bool MakePathAbsolute(const base::FilePath& current_directory, | 59 bool MakePathAbsolute(const base::FilePath& current_directory, |
60 base::FilePath* file_path) { | 60 base::FilePath* file_path) { |
61 DCHECK(file_path); | 61 DCHECK(file_path); |
62 if (file_path->IsAbsolute()) | 62 if (file_path->IsAbsolute()) |
63 return true; | 63 return true; |
64 | 64 |
65 if (current_directory.empty()) | 65 if (current_directory.empty()) { |
66 return file_util::AbsolutePath(file_path); | 66 *file_path = base::MakeAbsoluteFilePath(*file_path); |
| 67 return !file_path->empty(); |
| 68 } |
67 | 69 |
68 if (!current_directory.IsAbsolute()) | 70 if (!current_directory.IsAbsolute()) |
69 return false; | 71 return false; |
70 | 72 |
71 *file_path = current_directory.Append(*file_path); | 73 *file_path = current_directory.Append(*file_path); |
72 return true; | 74 return true; |
73 } | 75 } |
74 | 76 |
75 bool GetAbsolutePathFromCommandLine(const CommandLine* command_line, | 77 bool GetAbsolutePathFromCommandLine(const CommandLine* command_line, |
76 const base::FilePath& current_directory, | 78 const base::FilePath& current_directory, |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 void RestartPlatformAppWithFileEntries( | 415 void RestartPlatformAppWithFileEntries( |
414 Profile* profile, | 416 Profile* profile, |
415 const Extension* extension, | 417 const Extension* extension, |
416 const std::vector<SavedFileEntry>& file_entries) { | 418 const std::vector<SavedFileEntry>& file_entries) { |
417 scoped_refptr<SavedFileEntryLauncher> launcher = new SavedFileEntryLauncher( | 419 scoped_refptr<SavedFileEntryLauncher> launcher = new SavedFileEntryLauncher( |
418 profile, extension, file_entries); | 420 profile, extension, file_entries); |
419 launcher->Launch(); | 421 launcher->Launch(); |
420 } | 422 } |
421 | 423 |
422 } // namespace extensions | 424 } // namespace extensions |
OLD | NEW |