Chromium Code Reviews| 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 #ifndef REMOTING_HOST_DAEMON_INSTALLER_WIN_H_ | 5 #ifndef REMOTING_HOST_DAEMON_INSTALLER_WIN_H_ |
| 6 #define REMOTING_HOST_DAEMON_INSTALLER_WIN_H_ | 6 #define REMOTING_HOST_DAEMON_INSTALLER_WIN_H_ |
| 7 | 7 |
| 8 #include <objbase.h> | 8 #include <objbase.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "remoting/host/plugin/daemon_controller.h" | 13 #include "remoting/host/plugin/daemon_controller.h" |
| 14 | 14 |
| 15 namespace remoting { | 15 namespace remoting { |
| 16 | 16 |
| 17 class DaemonInstallerWin { | 17 class DaemonInstallerWin { |
| 18 public: | 18 public: |
| 19 typedef base::Callback<void (HRESULT result)> CompletionCallback; | 19 typedef base::Callback<void (HRESULT result)> CompletionCallback; |
| 20 | 20 |
| 21 virtual ~DaemonInstallerWin(); | 21 virtual ~DaemonInstallerWin(); |
| 22 | 22 |
| 23 // Initiates download and installation of the Chromoting Host. | 23 // Initiates download and installation of the Chromoting Host. |
| 24 virtual void Install() = 0; | 24 virtual void Install() = 0; |
| 25 | 25 |
| 26 // Creates an instance of the Chromoting Host installer passing the completion | 26 // Creates an instance of the Chromoting Host installer passing the completion |
| 27 // callback to be called when the installation finishes. In case of an error | 27 // callback to be called when the installation finishes. In case of an error |
| 28 // returns NULL and passed the error code to |done|. | 28 // returns NULL and passed the error code to |done|. |
| 29 static scoped_ptr<DaemonInstallerWin> Create(CompletionCallback done); | 29 static scoped_ptr<DaemonInstallerWin> Create(void* window_handle, |
|
Jamie
2012/04/25 21:20:37
HWND?
alexeypa (please no reviews)
2012/04/25 21:59:24
Done.
| |
| 30 CompletionCallback done); | |
|
Jamie
2012/04/25 21:20:37
Unrelated to this CL, but I don't understand why w
alexeypa (please no reviews)
2012/04/25 21:59:24
There are two different installer classes: DaemonC
| |
| 30 | 31 |
| 31 protected: | 32 protected: |
| 32 DaemonInstallerWin(const CompletionCallback& done); | 33 DaemonInstallerWin(const CompletionCallback& done); |
| 33 | 34 |
| 34 // Invokes the completion callback to report the installation result. | 35 // Invokes the completion callback to report the installation result. |
| 35 void Done(HRESULT result); | 36 void Done(HRESULT result); |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 // The completion callback that should be called to report the installation | 39 // The completion callback that should be called to report the installation |
| 39 // result. | 40 // result. |
| 40 CompletionCallback done_; | 41 CompletionCallback done_; |
| 41 | 42 |
| 42 DISALLOW_COPY_AND_ASSIGN(DaemonInstallerWin); | 43 DISALLOW_COPY_AND_ASSIGN(DaemonInstallerWin); |
| 43 }; | 44 }; |
| 44 | 45 |
| 46 // Returns the first top-level (i.e. WS_OVERLAPPED or WS_POPUP) window is | |
|
Jamie
2012/04/25 21:20:37
Nit: s/is/in/
alexeypa (please no reviews)
2012/04/25 21:59:24
Done.
| |
| 47 // the chain of parents of |window|. Returns |window| if it is itself represent | |
|
Jamie
2012/04/25 21:20:37
Nit: "if it is itself a top-level" or "if it repre
alexeypa (please no reviews)
2012/04/25 21:59:24
Done.
| |
| 48 // a top-level window. Returns NULL when |window| is NULL. | |
| 49 HWND GetTopLevelWindow(HWND window); | |
| 50 | |
| 45 } // namespace remoting | 51 } // namespace remoting |
| 46 | 52 |
| 47 #endif // REMOTING_HOST_DAEMON_INSTALLER_WIN_H_ | 53 #endif // REMOTING_HOST_DAEMON_INSTALLER_WIN_H_ |
| OLD | NEW |