Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: chrome/browser/extensions/platform_app_launcher.cc

Issue 13196006: Move path functions from file_util to FilePath object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 void RestartPlatformAppWithFileEntries( 419 void RestartPlatformAppWithFileEntries(
418 Profile* profile, 420 Profile* profile,
419 const Extension* extension, 421 const Extension* extension,
420 const std::vector<SavedFileEntry>& file_entries) { 422 const std::vector<SavedFileEntry>& file_entries) {
421 scoped_refptr<SavedFileEntryLauncher> launcher = new SavedFileEntryLauncher( 423 scoped_refptr<SavedFileEntryLauncher> launcher = new SavedFileEntryLauncher(
422 profile, extension, file_entries); 424 profile, extension, file_entries);
423 launcher->Launch(); 425 launcher->Launch();
424 } 426 }
425 427
426 } // namespace extensions 428 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698