Index: chrome/browser/chrome_process_finder_win.cc |
diff --git a/chrome/browser/chrome_process_finder_win.cc b/chrome/browser/chrome_process_finder_win.cc |
index 52efec5c464e1765650e7f8f11d713e9ed4326a2..9bae7d42640fd289a4397d71ddcb79ba5dd66f04 100644 |
--- a/chrome/browser/chrome_process_finder_win.cc |
+++ b/chrome/browser/chrome_process_finder_win.cc |
@@ -11,7 +11,7 @@ |
#include "base/files/file_path.h" |
#include "base/files/file_util.h" |
#include "base/logging.h" |
-#include "base/process/process_handle.h" |
+#include "base/process/process.h" |
#include "base/process/process_info.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/stringprintf.h" |
@@ -137,16 +137,10 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window, |
return NOTIFY_SUCCESS; |
} |
- base::win::ScopedHandle process_handle; |
- if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
- base::OpenProcessHandleWithAccess( |
- process_id, PROCESS_QUERY_INFORMATION, |
- process_handle.Receive())) { |
- // Receive() causes the process handle to be set in the destructor of the |
- // temporary receiver object, which does not happen until after the if |
- // statement is complete. So IsProcessImmersive() should only be checked |
- // as part of a separate if statement. |
- if (base::win::IsProcessImmersive(process_handle.Get())) |
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
+ base::Process process = |
+ base::Process::OpenWithAccess(process_id, PROCESS_QUERY_INFORMATION); |
+ if (process.IsValid() && base::win::IsProcessImmersive(process.Handle())) |
chrome::ActivateMetroChrome(); |
} |
#endif |