| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 namespace chrome { | 99 namespace chrome { |
| 100 | 100 |
| 101 HWND FindRunningChromeWindow(const base::FilePath& user_data_dir) { | 101 HWND FindRunningChromeWindow(const base::FilePath& user_data_dir) { |
| 102 return base::win::MessageWindow::FindWindow(user_data_dir.value()); | 102 return base::win::MessageWindow::FindWindow(user_data_dir.value()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window, | 105 NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window, |
| 106 bool fast_start) { | 106 bool fast_start) { |
| 107 DCHECK(remote_window); | 107 DCHECK(remote_window); |
| 108 static const char kSearchUrl[] = | |
| 109 "http://www.google.com/search?q=%s&sourceid=chrome&ie=UTF-8"; | |
| 110 DWORD process_id = 0; | 108 DWORD process_id = 0; |
| 111 DWORD thread_id = GetWindowThreadProcessId(remote_window, &process_id); | 109 DWORD thread_id = GetWindowThreadProcessId(remote_window, &process_id); |
| 112 if (!thread_id || !process_id) | 110 if (!thread_id || !process_id) |
| 113 return NOTIFY_FAILED; | 111 return NOTIFY_FAILED; |
| 114 | 112 |
| 115 base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); | 113 base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); |
| 116 command_line.AppendSwitchASCII( | 114 command_line.AppendSwitchASCII( |
| 117 switches::kOriginalProcessStartTime, | 115 switches::kOriginalProcessStartTime, |
| 118 base::Int64ToString( | 116 base::Int64ToString( |
| 119 base::CurrentProcessInfo::CreationTime().ToInternalValue())); | 117 base::CurrentProcessInfo::CreationTime().ToInternalValue())); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 154 } |
| 157 | 155 |
| 158 base::TimeDelta SetNotificationTimeoutForTesting(base::TimeDelta new_timeout) { | 156 base::TimeDelta SetNotificationTimeoutForTesting(base::TimeDelta new_timeout) { |
| 159 base::TimeDelta old_timeout = | 157 base::TimeDelta old_timeout = |
| 160 base::TimeDelta::FromMilliseconds(timeout_in_milliseconds); | 158 base::TimeDelta::FromMilliseconds(timeout_in_milliseconds); |
| 161 timeout_in_milliseconds = new_timeout.InMilliseconds(); | 159 timeout_in_milliseconds = new_timeout.InMilliseconds(); |
| 162 return old_timeout; | 160 return old_timeout; |
| 163 } | 161 } |
| 164 | 162 |
| 165 } // namespace chrome | 163 } // namespace chrome |
| OLD | NEW |