chrome_process_finder_win.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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
  3. // found in the LICENSE file.
  4. #ifndef CHROME_BROWSER_CHROME_PROCESS_FINDER_WIN_H_
  5. #define CHROME_BROWSER_CHROME_PROCESS_FINDER_WIN_H_
  6. #include <windows.h>
  7. #include "base/time/time.h"
  8. namespace base {
  9. class FilePath;
  10. }
  11. namespace chrome {
  12. enum NotifyChromeResult {
  13. NOTIFY_SUCCESS,
  14. NOTIFY_FAILED,
  15. NOTIFY_WINDOW_HUNG,
  16. };
  17. // Finds an already running Chrome window if it exists.
  18. HWND FindRunningChromeWindow(const base::FilePath& user_data_dir);
  19. // Attempts to send the current command line to an already running instance of
  20. // Chrome via a WM_COPYDATA message.
  21. // Returns true if a running Chrome is found and successfully notified.
  22. // |fast_start| is true when this is being called on the window fast start path.
  23. NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window,
  24. bool fast_start);
  25. // Changes the notification timeout to |new_timeout|, returns the old timeout.
  26. base::TimeDelta SetNotificationTimeoutForTesting(base::TimeDelta new_timeout);
  27. } // namespace chrome
  28. #endif // CHROME_BROWSER_CHROME_PROCESS_FINDER_WIN_H_