Make SkFontHost_fontconfig support TTC font files.
[chromium-blink-merge.git] / chrome_frame / module_utils.h
blob4cdf4b85e934e2b158d874e4e4a0292332a5e329
1 // Copyright (c) 2010 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.
5 #ifndef CHROME_FRAME_MODULE_UTILS_H_
6 #define CHROME_FRAME_MODULE_UTILS_H_
8 #include <ObjBase.h>
9 #include <windows.h>
11 class DllRedirector {
12 public:
13 // Attempts to register a window class under a well known name and appends to
14 // its extra data a handle to the current module. Will fail if the window
15 // class is already registered. This is intended to be called from DllMain
16 // under PROCESS_ATTACH.
17 static bool DllRedirector::RegisterAsFirstCFModule();
19 // Unregisters the well known window class if we registered it earlier.
20 // This is intended to be called from DllMain under PROCESS_DETACH.
21 static void DllRedirector::UnregisterAsFirstCFModule();
23 // Helper function that extracts the HMODULE parameter from our well known
24 // window class.
25 static HMODULE GetFirstCFModule();
27 // Helper function to return the DllGetClassObject function pointer from
28 // the given module. On success, the return value is non-null and module
29 // will have had its reference count incremented.
30 static LPFNGETCLASSOBJECT GetDllGetClassObjectPtr(HMODULE module);
32 private:
33 // Use this to keep track of whether or not we have registered the window
34 // class in this module.
35 static ATOM atom_;
37 friend class ModuleUtilsTest;
40 #endif // CHROME_FRAME_MODULE_UTILS_H_