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

Unified Diff: chrome/browser/ui/views/external_tab_container_win.cc

Issue 10892014: Make HWNDMessageHandler subclass WindowImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
Index: chrome/browser/ui/views/external_tab_container_win.cc
===================================================================
--- chrome/browser/ui/views/external_tab_container_win.cc (revision 153679)
+++ chrome/browser/ui/views/external_tab_container_win.cc (working copy)
@@ -164,7 +164,7 @@
const GURL& referrer,
bool infobars_enabled,
bool route_all_top_level_navigations) {
- if (IsWindow()) {
+ if (IsWindow(GetNativeView())) {
NOTREACHED();
return false;
}
@@ -179,7 +179,7 @@
params.bounds = bounds;
params.native_widget = this;
GetWidget()->Init(params);
- if (!IsWindow()) {
+ if (!IsWindow(GetNativeView())) {
NOTREACHED();
return false;
}
@@ -243,7 +243,9 @@
// Note that it's important to do this before we call SetParent since
// during the SetParent call we will otherwise get a WA_ACTIVATE call
// that causes us to steal the current focus.
- SetWindowLong(GWL_STYLE, (GetWindowLong(GWL_STYLE) & ~WS_POPUP) | style);
+ SetWindowLong(
+ GetNativeView(), GWL_STYLE,
+ (GetWindowLong(GetNativeView(), GWL_STYLE) & ~WS_POPUP) | style);
// Now apply the parenting and style
if (parent)
@@ -943,19 +945,23 @@
////////////////////////////////////////////////////////////////////////////////
// ExternalTabContainer, views::NativeWidgetWin overrides:
-LRESULT ExternalTabContainerWin::OnCreate(LPCREATESTRUCT create_struct) {
- LRESULT result = views::NativeWidgetWin::OnCreate(create_struct);
- if (result == 0) {
- // Grab a reference here which will be released in OnFinalMessage
- AddRef();
+bool ExternalTabContainerWin::PreHandleMSG(UINT message,
+ WPARAM w_param,
+ LPARAM l_param,
+ LRESULT* result) {
+ if (message == WM_DESTROY) {
+ prop_.reset();
+ Uninitialize();
}
- return result;
+ return false;
}
-void ExternalTabContainerWin::OnDestroy() {
- prop_.reset();
- Uninitialize();
- NativeWidgetWin::OnDestroy();
+void ExternalTabContainerWin::PostHandleMSG(UINT message,
+ WPARAM w_param,
+ LPARAM l_param) {
+ // Grab a reference here which will be released in OnFinalMessage
+ if (message == WM_CREATE)
+ AddRef();
}
void ExternalTabContainerWin::OnFinalMessage(HWND window) {
« no previous file with comments | « chrome/browser/ui/views/external_tab_container_win.h ('k') | chrome/browser/ui/views/frame/browser_frame_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698