OLD | NEW |
| (Empty) |
1 // Copyright 2006 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 // TODO(omaha): namespaces | |
17 | |
18 #ifndef OMAHA_BASE_BROWSER_UTILS_H_ | |
19 #define OMAHA_BASE_BROWSER_UTILS_H_ | |
20 | |
21 #include <windows.h> | |
22 #include <atlstr.h> | |
23 #include "base/basictypes.h" | |
24 | |
25 namespace omaha { | |
26 | |
27 // Must be kept in sync with the enum in base/omaha3_idl.idl. Do not include | |
28 // BROWSER_MAX in the IDL file. | |
29 // Do not move or remove existing elements. | |
30 enum BrowserType { | |
31 BROWSER_UNKNOWN = 0, | |
32 BROWSER_DEFAULT = 1, | |
33 BROWSER_IE = 2, | |
34 BROWSER_FIREFOX = 3, | |
35 BROWSER_CHROME = 4, | |
36 // Add new browsers above this. | |
37 BROWSER_MAX | |
38 }; | |
39 | |
40 // Read the browser information from legacy keys. See | |
41 // http://support.microsoft.com/kb/224816. | |
42 HRESULT GetLegacyDefaultBrowserInfo(CString* name, CString* browser_path); | |
43 | |
44 // Gets the default browser name. | |
45 // When calling this method from the local system account, the caller must | |
46 // impersonate the user first. This assumes the user profile is loaded under | |
47 // HKEY_USERS, which is true if the user has an interactive session. | |
48 // Otherwise, the caller must load the profile for the user before | |
49 // calling the function. | |
50 HRESULT GetDefaultBrowserName(CString* name); | |
51 | |
52 // Returns the default browser type. | |
53 HRESULT GetDefaultBrowserType(BrowserType* type); | |
54 | |
55 // Get the default browser path | |
56 HRESULT GetDefaultBrowserPath(CString* path); | |
57 | |
58 // Get the default profile of Firefox | |
59 HRESULT GetFirefoxDefaultProfile(CString* name, CString* path); | |
60 | |
61 // Returns the executable name corresponding to the browser type. | |
62 HRESULT BrowserTypeToProcessName(BrowserType type, CString* exe_name); | |
63 | |
64 // Returns the absolute filename of the browser executable. | |
65 HRESULT GetBrowserImagePath(BrowserType type, CString* path); | |
66 | |
67 // Terminates all the browsers identified by type for a user. | |
68 HRESULT TerminateBrowserProcess(BrowserType type, | |
69 const CString& sid, | |
70 int timeout_msec, | |
71 bool* found); | |
72 | |
73 // Waits for all instances of browser to die. | |
74 HRESULT WaitForBrowserToDie(BrowserType type, | |
75 const CString& sid, | |
76 int timeout_msec); | |
77 | |
78 // Launches the browser using RunAsCurrentUser. On failure, falls back to | |
79 // using ShellExecute. | |
80 HRESULT RunBrowser(BrowserType type, const CString& url); | |
81 | |
82 // Returns the current font size selection in Internet Explorer. | |
83 // Possible font size values: | |
84 // 0 : smallest font | |
85 // 1 : small font | |
86 // 2 : medium font | |
87 // 3 : large font | |
88 // 4 : largest font | |
89 HRESULT GetIeFontSize(uint32* font_size); | |
90 | |
91 } // namespace omaha | |
92 | |
93 #endif // OMAHA_BASE_BROWSER_UTILS_H_ | |
OLD | NEW |