Index: chrome/browser/extensions/app_host_installer_impl_win.h |
diff --git a/chrome/browser/extensions/app_host_installer_impl_win.h b/chrome/browser/extensions/app_host_installer_impl_win.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..12e6a4d473ca9fb738d43f6443f20ac715580927 |
--- /dev/null |
+++ b/chrome/browser/extensions/app_host_installer_impl_win.h |
@@ -0,0 +1,62 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_EXTENSIONS_APP_HOST_INSTALLER_IMPL_WIN_H_ |
+#define CHROME_BROWSER_EXTENSIONS_APP_HOST_INSTALLER_IMPL_WIN_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/callback_forward.h" |
+#include "base/win/object_watcher.h" |
+#include "content/public/browser/browser_thread.h" |
+ |
+namespace extensions { |
+ |
+class Extension; |
+ |
+namespace app_host_installer { |
+ |
+// App Host installation is necessary if |
erikwright (departed)
2012/10/09 19:24:48
This level of detail is inappropriate for the decl
huangs
2012/10/09 21:09:15
Done.
|
+// (1) |extension| is platform app, and |
+// (2) app_host_exe is not installed. |
+// (1) can be checked anywhere, but (2) must be checked in the FILE thread. |
+// App Host installation is also launched in the FILE thread as an |
+// asynchronous process. Once installation completes, QuickEnableWatcher |
+// is notified (on the FILE thread). This in turn notifies the caller thread |
+// which then proceed with the next step specified by |completion_callback|, |
+// on the caller thread. |
+class AppHostInstallerImpl { |
+ public: |
+ AppHostInstallerImpl(); |
erikwright (departed)
2012/10/09 19:24:48
private
huangs
2012/10/09 21:09:15
Done. Added two parameters.
|
+ |
+ // Implements AppHostInstaller::InstallAppHostIfNecessary(). |
erikwright (departed)
2012/10/09 19:24:48
// Asynchronously checks the system state and inst
huangs
2012/10/09 21:09:15
Done.
|
+ void InstallAppHostIfNecessary( |
erikwright (departed)
2012/10/09 19:24:48
static, and rename to EnsureAppHostInstalled, sinc
huangs
2012/10/09 21:09:15
Done.
|
+ const Extension& extension, |
+ const base::Callback<void(bool)>& completion_callback); |
+ |
+ private: |
+ ~AppHostInstallerImpl(); |
+ |
+ // Moves to the FILE thread. Continues InstallAppHostIfNecessary(). |
erikwright (departed)
2012/10/09 19:24:48
// Checks the system state on the FILE thread. Wil
huangs
2012/10/09 21:09:15
Done.
|
+ void InstallAppHostIfNecessaryInternal(); |
erikwright (departed)
2012/10/09 19:24:48
Rename to "EnsureAppHostInstalledInternal"
huangs
2012/10/09 21:09:15
Done.
|
+ |
+ // Runs on the FILE thread. Installs App Host. |
erikwright (departed)
2012/10/09 19:24:48
// Asynchronously triggers the App Host installati
huangs
2012/10/09 21:09:15
Done.
|
+ void InstallAppHost(); |
+ |
+ // Moves to the caller thread, calls |completion_callback| with |success|. |
+ void Finish(bool success); |
erikwright (departed)
2012/10/09 19:24:48
// Passes |success| to |completion_callback| on th
huangs
2012/10/09 21:09:15
Done.
|
+ |
+ base::win::ScopedHandle process_; |
+ base::win::ObjectWatcher watcher_; |
+ scoped_ptr<base::win::ObjectWatcher::Delegate> delegate_; |
+ content::BrowserThread::ID caller_thread_id_; |
+ base::Callback<void(bool)> completion_callback_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AppHostInstallerImpl); |
+}; |
+ |
+} // namespace app_host_installer |
+ |
+} // namespace extensions |
+ |
+#endif // CHROME_BROWSER_EXTENSIONS_APP_HOST_INSTALLER_IMPL_WIN_H_ |