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

Unified Diff: chrome_frame/module_utils.cc

Issue 3107002: Merge 55474 - Fix chrome frame upgrade from old to new beta... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/module_utils.cc
===================================================================
--- chrome_frame/module_utils.cc (revision 55474)
+++ chrome_frame/module_utils.cc (working copy)
@@ -47,6 +47,19 @@
if (GetClassInfoEx(GetModuleHandle(NULL), kBeaconWindowClassName,
&wnd_class)) {
oldest_module = reinterpret_cast<HMODULE>(wnd_class.lpfnWndProc);
+ // Handle older versions that store module pointer in a class info.
+ // TODO(amit): Remove this in future versions.
+ if (reinterpret_cast<HMODULE>(DefWindowProc) == oldest_module) {
+ WNDCLASSEX wnd_class = {0};
+ HMODULE oldest_module = NULL;
+ HWND hwnd = CreateWindow(kBeaconWindowClassName, L"temp_window",
+ WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
+ DCHECK(IsWindow(hwnd));
+ if (hwnd) {
+ oldest_module = reinterpret_cast<HMODULE>(GetClassLongPtr(hwnd, 0));
+ DestroyWindow(hwnd);
+ }
+ }
}
return oldest_module;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698