| 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 "chrome/browser/chrome_process_finder_win.h" | 5 #include "chrome/browser/chrome_process_finder_win.h" |
| 6 | 6 |
| 7 #include <shellapi.h> | 7 #include <shellapi.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 process_id, PROCESS_QUERY_INFORMATION, | 142 process_id, PROCESS_QUERY_INFORMATION, |
| 143 process_handle.Receive()) && | 143 process_handle.Receive()) && |
| 144 base::win::IsProcessImmersive(process_handle.Get())) { | 144 base::win::IsProcessImmersive(process_handle.Get())) { |
| 145 chrome::ActivateMetroChrome(); | 145 chrome::ActivateMetroChrome(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 CommandLine command_line(*CommandLine::ForCurrentProcess()); | 148 CommandLine command_line(*CommandLine::ForCurrentProcess()); |
| 149 command_line.AppendSwitchASCII( | 149 command_line.AppendSwitchASCII( |
| 150 switches::kOriginalProcessStartTime, | 150 switches::kOriginalProcessStartTime, |
| 151 base::Int64ToString( | 151 base::Int64ToString( |
| 152 base::CurrentProcessInfo::CreationTime()->ToInternalValue())); | 152 base::CurrentProcessInfo::CreationTime().ToInternalValue())); |
| 153 | 153 |
| 154 if (fast_start) | 154 if (fast_start) |
| 155 command_line.AppendSwitch(switches::kFastStart); | 155 command_line.AppendSwitch(switches::kFastStart); |
| 156 | 156 |
| 157 // Send the command line to the remote chrome window. | 157 // Send the command line to the remote chrome window. |
| 158 // Format is "START\0<<<current directory>>>\0<<<commandline>>>". | 158 // Format is "START\0<<<current directory>>>\0<<<commandline>>>". |
| 159 std::wstring to_send(L"START\0", 6); // want the NULL in the string. | 159 std::wstring to_send(L"START\0", 6); // want the NULL in the string. |
| 160 base::FilePath cur_dir; | 160 base::FilePath cur_dir; |
| 161 if (!file_util::GetCurrentDirectory(&cur_dir)) | 161 if (!file_util::GetCurrentDirectory(&cur_dir)) |
| 162 return NOTIFY_FAILED; | 162 return NOTIFY_FAILED; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 186 | 186 |
| 187 // It is possible that the process owning this window may have died by now. | 187 // It is possible that the process owning this window may have died by now. |
| 188 if (!::IsWindow(remote_window)) | 188 if (!::IsWindow(remote_window)) |
| 189 return NOTIFY_FAILED; | 189 return NOTIFY_FAILED; |
| 190 | 190 |
| 191 // If the window couldn't be notified but still exists, assume it is hung. | 191 // If the window couldn't be notified but still exists, assume it is hung. |
| 192 return NOTIFY_WINDOW_HUNG; | 192 return NOTIFY_WINDOW_HUNG; |
| 193 } | 193 } |
| 194 | 194 |
| 195 } // namespace chrome | 195 } // namespace chrome |
| OLD | NEW |