Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: chrome/browser/extensions/app_host_installer_impl_win.h

Issue 11054006: Make application shortcuts point to app_host.exe, install App Host during app installation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Now installing App Host in AppShortcutManager, instead of CrxInstaller / UnpackedInstaller. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_APP_HOST_INSTALLER_IMPL_WIN_H_
6 #define CHROME_BROWSER_EXTENSIONS_APP_HOST_INSTALLER_IMPL_WIN_H_
7
8 #include "base/basictypes.h"
9 #include "base/callback_forward.h"
10 #include "base/win/object_watcher.h"
11 #include "chrome/browser/extensions/app_host_installer.h"
12 #include "content/public/browser/browser_thread.h"
13
14 namespace extensions {
15
16 class Extension;
17
18 namespace app_host_installer {
19
20 using content::BrowserThread;
21
22 // Determines if the App Host is installed and, if not, installs it.
23 class AppHostInstallerImpl {
24 public:
25 // Asynchronously checks the system state and installs the App Host if not
26 // present. |completion_callback| will be notified on the caller's thread
27 // when the installation process completes, and is passed a boolean to
28 // indicate success or failure of installation.
29 // No timeout is used - thus |completion_callback| may be held for an
30 // arbitrarily long time, including past browser shutdown.
31 static void EnsureAppHostInstalled(
32 const OnAppHostInstallationCompleteCallback& completion_callback);
33
34 private:
35 // Constructs an AppHostInstallerImpl, which will call |completion_callback|
36 // on the specified thread upon installation completion.
37 AppHostInstallerImpl(
38 const OnAppHostInstallationCompleteCallback& completion_callback,
39 BrowserThread::ID caller_thread_id);
40
41 ~AppHostInstallerImpl();
42
43 // Checks the system state on the FILE thread. Will call
44 // InstallAppHostOnFileThread() if App Host is not installed.
45 void EnsureAppHostInstalledInternal();
46
47 // Runs on the FILE thread. Installs App Host by asynchronously triggering
48 // App Host installation. Will call FinishOnCallerThread() upon completion
49 // (successful or otherwise).
50 void InstallAppHostOnFileThread();
51
52 // Passes |success| to |completion_callback| on the original caller thread.
53 // Deletes the AppHostInstallerImpl.
54 void FinishOnCallerThread(bool success);
55
56 OnAppHostInstallationCompleteCallback completion_callback_;
57 BrowserThread::ID caller_thread_id_;
58 base::win::ScopedHandle process_;
59 scoped_ptr<base::win::ObjectWatcher::Delegate> delegate_;
60 base::win::ObjectWatcher watcher_;
61
62 DISALLOW_COPY_AND_ASSIGN(AppHostInstallerImpl);
63 };
64
65 } // namespace app_host_installer
66
67 } // namespace extensions
68
69 #endif // CHROME_BROWSER_EXTENSIONS_APP_HOST_INSTALLER_IMPL_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698