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 "content/shell/app/shell_main_delegate_mac.h" | 5 #include "content/shell/app/shell_main_delegate_mac.h" |
6 | 6 |
7 #include <unistd.h> | 7 #include <unistd.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/mac/foundation_util.h" | 12 #include "base/mac/foundation_util.h" |
13 #include "base/mac/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
14 #include "base/path_service.h" | |
15 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
16 #include "content/shell/app/paths_mac.h" | 15 #include "content/shell/app/paths_mac.h" |
17 #include "content/shell/common/shell_switches.h" | 16 #include "content/shell/common/shell_switches.h" |
18 | 17 |
19 namespace content { | 18 namespace content { |
20 | 19 |
21 void EnsureCorrectResolutionSettings() { | 20 void EnsureCorrectResolutionSettings() { |
22 // Exit early if this isn't a browser process. | 21 // Exit early if this isn't a browser process. |
23 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) | 22 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) |
24 return; | 23 return; |
(...skipping 21 matching lines...) Expand all Loading... |
46 CommandLine::ForCurrentProcess()->argv(); | 45 CommandLine::ForCurrentProcess()->argv(); |
47 char** argv = new char*[original_argv.size() + 1]; | 46 char** argv = new char*[original_argv.size() + 1]; |
48 for (unsigned i = 0; i < original_argv.size(); ++i) | 47 for (unsigned i = 0; i < original_argv.size(); ++i) |
49 argv[i] = const_cast<char*>(original_argv.at(i).c_str()); | 48 argv[i] = const_cast<char*>(original_argv.at(i).c_str()); |
50 argv[original_argv.size()] = NULL; | 49 argv[original_argv.size()] = NULL; |
51 | 50 |
52 CHECK(execvp(argv[0], argv)); | 51 CHECK(execvp(argv[0], argv)); |
53 } | 52 } |
54 | 53 |
55 } // namespace content | 54 } // namespace content |
OLD | NEW |