OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/host/setup/daemon_installer_win.h" | 5 #include "remoting/host/setup/daemon_installer_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 } else if (result == CO_E_CLASSSTRING) { | 375 } else if (result == CO_E_CLASSSTRING) { |
376 // The machine instance of Omaha is not available so we will have to run | 376 // The machine instance of Omaha is not available so we will have to run |
377 // GoogleUpdate.exe manually passing "needsadmin=True". This will cause | 377 // GoogleUpdate.exe manually passing "needsadmin=True". This will cause |
378 // Omaha to install the machine instance first and then install Chromoting | 378 // Omaha to install the machine instance first and then install Chromoting |
379 // Host. | 379 // Host. |
380 return scoped_ptr<DaemonInstallerWin>( | 380 return scoped_ptr<DaemonInstallerWin>( |
381 new DaemonCommandLineInstallerWin(done)); | 381 new DaemonCommandLineInstallerWin(done)); |
382 } else { | 382 } else { |
383 // The user declined the UAC prompt or some other error occured. | 383 // The user declined the UAC prompt or some other error occured. |
384 done.Run(result); | 384 done.Run(result); |
385 return scoped_ptr<DaemonInstallerWin>(); | 385 return nullptr; |
386 } | 386 } |
387 } | 387 } |
388 | 388 |
389 HWND GetTopLevelWindow(HWND window) { | 389 HWND GetTopLevelWindow(HWND window) { |
390 if (window == NULL) { | 390 if (window == NULL) { |
391 return NULL; | 391 return NULL; |
392 } | 392 } |
393 | 393 |
394 for (;;) { | 394 for (;;) { |
395 LONG style = GetWindowLong(window, GWL_STYLE); | 395 LONG style = GetWindowLong(window, GWL_STYLE); |
396 if ((style & WS_OVERLAPPEDWINDOW) == WS_OVERLAPPEDWINDOW || | 396 if ((style & WS_OVERLAPPEDWINDOW) == WS_OVERLAPPEDWINDOW || |
397 (style & WS_POPUP) == WS_POPUP) { | 397 (style & WS_POPUP) == WS_POPUP) { |
398 return window; | 398 return window; |
399 } | 399 } |
400 | 400 |
401 HWND parent = GetAncestor(window, GA_PARENT); | 401 HWND parent = GetAncestor(window, GA_PARENT); |
402 if (parent == NULL) { | 402 if (parent == NULL) { |
403 return window; | 403 return window; |
404 } | 404 } |
405 | 405 |
406 window = parent; | 406 window = parent; |
407 } | 407 } |
408 } | 408 } |
409 | 409 |
410 } // namespace remoting | 410 } // namespace remoting |
OLD | NEW |