| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 namespace remoting { | 63 namespace remoting { |
| 64 | 64 |
| 65 // This class implements on-demand installation of the Chromoting Host via | 65 // This class implements on-demand installation of the Chromoting Host via |
| 66 // per-machine Omaha instance. | 66 // per-machine Omaha instance. |
| 67 class DaemonComInstallerWin : public DaemonInstallerWin { | 67 class DaemonComInstallerWin : public DaemonInstallerWin { |
| 68 public: | 68 public: |
| 69 DaemonComInstallerWin(const ScopedComPtr<IDispatch>& update3, | 69 DaemonComInstallerWin(const ScopedComPtr<IDispatch>& update3, |
| 70 const CompletionCallback& done); | 70 const CompletionCallback& done); |
| 71 | 71 |
| 72 // DaemonInstallerWin implementation. | 72 // DaemonInstallerWin implementation. |
| 73 virtual void Install() OVERRIDE; | 73 virtual void Install() override; |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 // Polls the installation status performing state-specific actions (such as | 76 // Polls the installation status performing state-specific actions (such as |
| 77 // starting installation once download has finished). | 77 // starting installation once download has finished). |
| 78 void PollInstallationStatus(); | 78 void PollInstallationStatus(); |
| 79 | 79 |
| 80 // Omaha interfaces. | 80 // Omaha interfaces. |
| 81 ScopedVariant app_; | 81 ScopedVariant app_; |
| 82 ScopedVariant bundle_; | 82 ScopedVariant bundle_; |
| 83 ScopedComPtr<IDispatch> update3_; | 83 ScopedComPtr<IDispatch> update3_; |
| 84 | 84 |
| 85 base::Timer polling_timer_; | 85 base::Timer polling_timer_; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // This class implements on-demand installation of the Chromoting Host by | 88 // This class implements on-demand installation of the Chromoting Host by |
| 89 // launching a per-user instance of Omaha and requesting elevation. | 89 // launching a per-user instance of Omaha and requesting elevation. |
| 90 class DaemonCommandLineInstallerWin | 90 class DaemonCommandLineInstallerWin |
| 91 : public DaemonInstallerWin, | 91 : public DaemonInstallerWin, |
| 92 public base::win::ObjectWatcher::Delegate { | 92 public base::win::ObjectWatcher::Delegate { |
| 93 public: | 93 public: |
| 94 DaemonCommandLineInstallerWin(const CompletionCallback& done); | 94 DaemonCommandLineInstallerWin(const CompletionCallback& done); |
| 95 ~DaemonCommandLineInstallerWin(); | 95 ~DaemonCommandLineInstallerWin(); |
| 96 | 96 |
| 97 // DaemonInstallerWin implementation. | 97 // DaemonInstallerWin implementation. |
| 98 virtual void Install() OVERRIDE; | 98 virtual void Install() override; |
| 99 | 99 |
| 100 // base::win::ObjectWatcher::Delegate implementation. | 100 // base::win::ObjectWatcher::Delegate implementation. |
| 101 virtual void OnObjectSignaled(HANDLE object) OVERRIDE; | 101 virtual void OnObjectSignaled(HANDLE object) override; |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 // Handle of the launched process. | 104 // Handle of the launched process. |
| 105 base::win::ScopedHandle process_; | 105 base::win::ScopedHandle process_; |
| 106 | 106 |
| 107 // Used to determine when the launched process terminates. | 107 // Used to determine when the launched process terminates. |
| 108 base::win::ObjectWatcher process_watcher_; | 108 base::win::ObjectWatcher process_watcher_; |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 DaemonComInstallerWin::DaemonComInstallerWin( | 111 DaemonComInstallerWin::DaemonComInstallerWin( |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 HWND parent = GetAncestor(window, GA_PARENT); | 402 HWND parent = GetAncestor(window, GA_PARENT); |
| 403 if (parent == NULL) { | 403 if (parent == NULL) { |
| 404 return window; | 404 return window; |
| 405 } | 405 } |
| 406 | 406 |
| 407 window = parent; | 407 window = parent; |
| 408 } | 408 } |
| 409 } | 409 } |
| 410 | 410 |
| 411 } // namespace remoting | 411 } // namespace remoting |
| OLD | NEW |