| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/launcher.h" | 5 #include "apps/launcher.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 const char kFallbackMimeType[] = "application/octet-stream"; | 65 const char kFallbackMimeType[] = "application/octet-stream"; |
| 66 | 66 |
| 67 bool DoMakePathAbsolute(const base::FilePath& current_directory, | 67 bool DoMakePathAbsolute(const base::FilePath& current_directory, |
| 68 base::FilePath* file_path) { | 68 base::FilePath* file_path) { |
| 69 DCHECK(file_path); | 69 DCHECK(file_path); |
| 70 if (file_path->IsAbsolute()) | 70 if (file_path->IsAbsolute()) |
| 71 return true; | 71 return true; |
| 72 | 72 |
| 73 if (current_directory.empty()) { | 73 if (current_directory.empty()) { |
| 74 *file_path = base::MakeAbsoluteFilePath(*file_path); | 74 base::FilePath absolute_path = base::MakeAbsoluteFilePath(*file_path); |
| 75 return !file_path->empty(); | 75 if (absolute_path.empty()) |
| 76 return false; |
| 77 *file_path = absolute_path; |
| 78 return true; |
| 76 } | 79 } |
| 77 | 80 |
| 78 if (!current_directory.IsAbsolute()) | 81 if (!current_directory.IsAbsolute()) |
| 79 return false; | 82 return false; |
| 80 | 83 |
| 81 *file_path = current_directory.Append(*file_path); | 84 *file_path = current_directory.Append(*file_path); |
| 82 return true; | 85 return true; |
| 83 } | 86 } |
| 84 | 87 |
| 85 // Helper method to launch the platform app |extension| with no data. This | 88 // Helper method to launch the platform app |extension| with no data. This |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 void LaunchPlatformAppWithUrl(Profile* profile, | 405 void LaunchPlatformAppWithUrl(Profile* profile, |
| 403 const Extension* extension, | 406 const Extension* extension, |
| 404 const std::string& handler_id, | 407 const std::string& handler_id, |
| 405 const GURL& url, | 408 const GURL& url, |
| 406 const GURL& referrer_url) { | 409 const GURL& referrer_url) { |
| 407 AppRuntimeEventRouter::DispatchOnLaunchedEventWithUrl( | 410 AppRuntimeEventRouter::DispatchOnLaunchedEventWithUrl( |
| 408 profile, extension, handler_id, url, referrer_url); | 411 profile, extension, handler_id, url, referrer_url); |
| 409 } | 412 } |
| 410 | 413 |
| 411 } // namespace apps | 414 } // namespace apps |
| OLD | NEW |