OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "shell/command_line_util.h" | 5 #include "shell/command_line_util.h" |
6 | 6 |
7 #include <functional> | 7 #include <functional> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 void ApplyApplicationArgs(Context* context, const std::string& args) { | 67 void ApplyApplicationArgs(Context* context, const std::string& args) { |
68 std::string args_for_value; | 68 std::string args_for_value; |
69 if (ParseArgsFor(args, &args_for_value)) | 69 if (ParseArgsFor(args, &args_for_value)) |
70 GetAppURLAndSetArgs(args_for_value, context); | 70 GetAppURLAndSetArgs(args_for_value, context); |
71 } | 71 } |
72 | 72 |
73 void RunCommandLineApps(Context* context) { | 73 void RunCommandLineApps(Context* context) { |
74 const auto& command_line = *base::CommandLine::ForCurrentProcess(); | 74 const auto& command_line = *base::CommandLine::ForCurrentProcess(); |
75 for (const auto& arg : command_line.GetArgs()) { | 75 for (const auto& arg : command_line.GetArgs()) { |
76 std::string arg2; | 76 GURL url = GetAppURLAndSetArgs(arg, context); |
77 #if defined(OS_WIN) | |
78 arg2 = base::UTF16ToUTF8(arg); | |
79 #else | |
80 arg2 = arg; | |
81 #endif | |
82 GURL url = GetAppURLAndSetArgs(arg2, context); | |
83 if (!url.is_valid()) | 77 if (!url.is_valid()) |
84 return; | 78 return; |
85 context->Run(url); | 79 context->Run(url); |
86 } | 80 } |
87 } | 81 } |
88 | 82 |
89 } // namespace shell | 83 } // namespace shell |
90 } // namespace mojo | 84 } // namespace mojo |
OLD | NEW |