| 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/win/chrome_process_finder.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" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/process/process.h" | 14 #include "base/process/process.h" |
| 15 #include "base/process/process_info.h" | 15 #include "base/process/process_info.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "base/win/message_window.h" | 19 #include "base/win/message_window.h" |
| 20 #include "base/win/scoped_handle.h" | 20 #include "base/win/scoped_handle.h" |
| 21 #include "base/win/win_util.h" | 21 #include "base/win/win_util.h" |
| 22 #include "base/win/windows_version.h" | 22 #include "base/win/windows_version.h" |
| 23 #include "chrome/common/chrome_constants.h" | 23 #include "chrome/common/chrome_constants.h" |
| 24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 25 | 25 |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 int timeout_in_milliseconds = 20 * 1000; | 29 int timeout_in_milliseconds = 20 * 1000; |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 32 | 32 |
| 33 namespace chrome { | 33 namespace chrome { |
| 34 namespace win { |
| 34 | 35 |
| 35 HWND FindRunningChromeWindow(const base::FilePath& user_data_dir) { | 36 HWND FindRunningChromeWindow(const base::FilePath& user_data_dir) { |
| 36 return base::win::MessageWindow::FindWindow(user_data_dir.value()); | 37 return base::win::MessageWindow::FindWindow(user_data_dir.value()); |
| 37 } | 38 } |
| 38 | 39 |
| 39 NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window, | 40 NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window, |
| 40 bool fast_start) { | 41 bool fast_start) { |
| 41 DCHECK(remote_window); | 42 DCHECK(remote_window); |
| 42 DWORD process_id = 0; | 43 DWORD process_id = 0; |
| 43 DWORD thread_id = GetWindowThreadProcessId(remote_window, &process_id); | 44 DWORD thread_id = GetWindowThreadProcessId(remote_window, &process_id); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 return NOTIFY_WINDOW_HUNG; | 88 return NOTIFY_WINDOW_HUNG; |
| 88 } | 89 } |
| 89 | 90 |
| 90 base::TimeDelta SetNotificationTimeoutForTesting(base::TimeDelta new_timeout) { | 91 base::TimeDelta SetNotificationTimeoutForTesting(base::TimeDelta new_timeout) { |
| 91 base::TimeDelta old_timeout = | 92 base::TimeDelta old_timeout = |
| 92 base::TimeDelta::FromMilliseconds(timeout_in_milliseconds); | 93 base::TimeDelta::FromMilliseconds(timeout_in_milliseconds); |
| 93 timeout_in_milliseconds = new_timeout.InMilliseconds(); | 94 timeout_in_milliseconds = new_timeout.InMilliseconds(); |
| 94 return old_timeout; | 95 return old_timeout; |
| 95 } | 96 } |
| 96 | 97 |
| 98 } // namespace win |
| 97 } // namespace chrome | 99 } // namespace chrome |
| OLD | NEW |