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

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: Move AsAbsolute back out of FilePath 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698