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

Side by Side Diff: plugin/win/main_win.cc

Issue 6732033: Fixing a random hang when exiting full screen in chome. The same bug doesn't (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 } 662 }
663 663
664 obj->SetHWnd(NULL); 664 obj->SetHWnd(NULL);
665 } 665 }
666 666
667 // Re-parents the content_hwnd into the containing_hwnd, resizing the 667 // Re-parents the content_hwnd into the containing_hwnd, resizing the
668 // content_hwnd to the given width and height in the process. 668 // content_hwnd to the given width and height in the process.
669 void ReplaceContentWindow(HWND content_hwnd, 669 void ReplaceContentWindow(HWND content_hwnd,
670 HWND containing_hwnd, 670 HWND containing_hwnd,
671 int width, int height) { 671 int width, int height) {
672 ::ShowWindow(content_hwnd, SW_HIDE); 672 // In Chrome browser, IPC might block this call. This doesn't happen with
673 // firefox or internet explorer. For Chome, do not hide the window. Haven't
674 // any artifacts with this change when exiting from full screen.
675 PluginObject *obj = PluginObject::GetPluginProperty(content_hwnd);
676 if (obj && !obj->IsChrome()) {
677 ::ShowWindow(content_hwnd, SW_HIDE);
678 }
673 LONG_PTR style = ::GetWindowLongPtr(content_hwnd, GWL_STYLE); 679 LONG_PTR style = ::GetWindowLongPtr(content_hwnd, GWL_STYLE);
674 style |= WS_CHILD; 680 style |= WS_CHILD;
675 ::SetWindowLongPtr(content_hwnd, GWL_STYLE, style); 681 ::SetWindowLongPtr(content_hwnd, GWL_STYLE, style);
676 LONG_PTR exstyle = ::GetWindowLongPtr(content_hwnd, GWL_EXSTYLE); 682 LONG_PTR exstyle = ::GetWindowLongPtr(content_hwnd, GWL_EXSTYLE);
677 exstyle &= ~WS_EX_TOOLWINDOW; 683 exstyle &= ~WS_EX_TOOLWINDOW;
678 ::SetWindowLongPtr(content_hwnd, GWL_EXSTYLE, exstyle); 684 ::SetWindowLongPtr(content_hwnd, GWL_EXSTYLE, exstyle);
679 ::SetParent(content_hwnd, containing_hwnd); 685 ::SetParent(content_hwnd, containing_hwnd);
680 BOOL res = ::SetWindowPos(content_hwnd, containing_hwnd, 686 BOOL res = ::SetWindowPos(content_hwnd, containing_hwnd,
681 0, 0, width, height, 687 0, 0, width, height,
682 SWP_NOZORDER | SWP_ASYNCWINDOWPOS); 688 SWP_NOZORDER | SWP_ASYNCWINDOWPOS);
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 if (!renderer_->CancelFullscreen(display, prev_width_, prev_height_)) { 947 if (!renderer_->CancelFullscreen(display, prev_width_, prev_height_)) {
942 LOG(FATAL) << "Failed to get the renderer out of fullscreen mode!"; 948 LOG(FATAL) << "Failed to get the renderer out of fullscreen mode!";
943 } 949 }
944 ReplaceContentWindow(GetContentHWnd(), GetPluginHWnd(), 950 ReplaceContentWindow(GetContentHWnd(), GetPluginHWnd(),
945 prev_width_, prev_height_); 951 prev_width_, prev_height_);
946 client()->SendResizeEvent(prev_width_, prev_height_, false); 952 client()->SendResizeEvent(prev_width_, prev_height_, false);
947 } 953 }
948 } 954 }
949 } // namespace _o3d 955 } // namespace _o3d
950 } // namespace glue 956 } // namespace glue
OLDNEW
« 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