OLD | NEW |
| (Empty) |
1 // Copyright 2008-2009 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 // This is for Omaha2 backwards compatibility. | |
16 // The installed Omaha3 handoff process sets an event to tell an Omaha2 setup | |
17 // worker running from the temp directory that a UI has been displayed so that | |
18 // the Omaha2 worker will not display a second UI on error. The event's name is | |
19 // passed in an environment variable name by the Omaha2 worker. | |
20 | |
21 #ifndef OMAHA_UI_UI_DISPLAYED_EVENT_H_ | |
22 #define OMAHA_UI_UI_DISPLAYED_EVENT_H_ | |
23 | |
24 #include <windows.h> | |
25 #include "omaha/base/scoped_any.h" | |
26 | |
27 namespace omaha { | |
28 | |
29 // Manages the UI Displayed Event, which is used to communicate whether a UI | |
30 // has been displayed between processes. | |
31 // This class is not thread safe. | |
32 class UIDisplayedEventManager { | |
33 public: | |
34 // Signals the event. Creates it if its name does not already exist in the | |
35 // environment variable. | |
36 static void SignalEvent(bool is_machine); | |
37 | |
38 private: | |
39 // Creates the event and sets its name in the environment variable. | |
40 static HRESULT CreateEvent(bool is_machine); | |
41 | |
42 // Gets the event from the name in the environment variable. | |
43 static HRESULT GetEvent(bool is_machine, HANDLE* ui_displayed_event); | |
44 | |
45 // Returns whether this process's event handle has been initialized. | |
46 static bool IsEventHandleInitialized(); | |
47 | |
48 // A single instance of the UI Displayed Event handle to be used for the | |
49 // lifetime of this process. | |
50 static scoped_handle ui_displayed_event_; | |
51 }; | |
52 | |
53 } // namespace omaha | |
54 | |
55 #endif // OMAHA_UI_UI_DISPLAYED_EVENT_H_ | |
OLD | NEW |