OLD | NEW |
| (Empty) |
1 // Copyright 2009-2010 Google Inc. | |
2 // | |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 // you may not use this file except in compliance with the License. | |
5 // You may obtain a copy of the License at | |
6 // | |
7 // http://www.apache.org/licenses/LICENSE-2.0 | |
8 // | |
9 // Unless required by applicable law or agreed to in writing, software | |
10 // distributed under the License is distributed on an "AS IS" BASIS, | |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 // See the License for the specific language governing permissions and | |
13 // limitations under the License. | |
14 // ======================================================================== | |
15 | |
16 | |
17 #ifndef OMAHA_CLIENT_INSTALL_APPS_INTERNAL_H_ | |
18 #define OMAHA_CLIENT_INSTALL_APPS_INTERNAL_H_ | |
19 | |
20 #include <windows.h> | |
21 #include <atlstr.h> | |
22 #include <vector> | |
23 #include "omaha/base/browser_utils.h" | |
24 #include "goopdate/omaha3_idl.h" | |
25 #include "omaha/ui/progress_wnd.h" | |
26 | |
27 namespace omaha { | |
28 | |
29 class AppBundle; | |
30 class BundleInstaller; | |
31 struct CommandLineExtraArgs; | |
32 | |
33 namespace internal { | |
34 | |
35 // TODO(omaha): Figure out how to handle pause requests. | |
36 class InstallAppsWndEvents : public ProgressWndEvents { | |
37 public: | |
38 InstallAppsWndEvents(bool is_machine, | |
39 BundleInstaller* installer, | |
40 BrowserType browser_type); | |
41 | |
42 virtual void DoClose(); | |
43 virtual void DoExit(); | |
44 virtual void DoCancel(); | |
45 virtual bool DoLaunchBrowser(const CString& url); | |
46 | |
47 // When a valid browser type is specified in the command line, that type of | |
48 // browser will be restarted. | |
49 virtual bool DoRestartBrowser(bool restart_all_browsers, | |
50 const std::vector<CString>& urls); | |
51 virtual bool DoReboot(); | |
52 | |
53 private: | |
54 bool is_machine_; | |
55 BundleInstaller* installer_; | |
56 BrowserType browser_type_; | |
57 | |
58 DISALLOW_IMPLICIT_CONSTRUCTORS(InstallAppsWndEvents); | |
59 }; | |
60 | |
61 // On success, the caller takes ownership of observer and ui_sink. | |
62 HRESULT CreateClientUI(bool is_machine, | |
63 BrowserType browser_type, | |
64 BundleInstaller* installer, | |
65 AppBundle* app_bundle, | |
66 InstallProgressObserver** observer, | |
67 OmahaWndEvents** ui_sink); | |
68 | |
69 // Does the work for InstallApps, allowing the COM server to be mocked. | |
70 HRESULT DoInstallApps(BundleInstaller* installer, | |
71 IAppBundle* app_bundle, | |
72 bool is_machine, | |
73 bool is_interactive, | |
74 bool is_update_all_apps, | |
75 BrowserType browser_type, | |
76 bool* has_ui_been_displayed); | |
77 | |
78 // Displays an error message and reports the error as appropriate. | |
79 void HandleInstallAppsError(HRESULT error, | |
80 int extra_code1, | |
81 bool is_machine, | |
82 bool is_interactive, | |
83 bool is_eula_required, | |
84 bool is_oem_install, | |
85 const CommandLineExtraArgs& extra_args, | |
86 bool* has_ui_been_displayed); | |
87 | |
88 } // namespace internal | |
89 | |
90 } // namespace omaha | |
91 | |
92 #endif // OMAHA_CLIENT_INSTALL_APPS_INTERNAL_H_ | |
OLD | NEW |