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

Side by Side Diff: apps/launcher.cc

Issue 665053002: App launcher: Fix warning log on unresolvable relative paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698