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

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

Issue 10867096: 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 153552)
+++ chrome/browser/ui/views/external_tab_container_win.cc (working copy)
@@ -66,6 +66,7 @@
#include "ui/base/view_prop.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/layout/grid_layout.h"
+#include "ui/views/win/hwnd_message_handler.h"
using content::BrowserThread;
using content::LoadNotificationDetails;
@@ -164,7 +165,7 @@
const GURL& referrer,
bool infobars_enabled,
bool route_all_top_level_navigations) {
- if (IsWindow()) {
+ if (IsWindow(GetNativeView())) {
NOTREACHED();
return false;
}
@@ -173,13 +174,13 @@
handle_top_level_requests_ = handle_top_level_requests;
route_all_top_level_navigations_ = route_all_top_level_navigations;
- set_window_style(WS_POPUP | WS_CLIPCHILDREN);
+ GetMessageHandler()->set_window_style(WS_POPUP | WS_CLIPCHILDREN);
views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
params.bounds = bounds;
params.native_widget = this;
GetWidget()->Init(params);
- if (!IsWindow()) {
+ if (!IsWindow(GetNativeView())) {
NOTREACHED();
return false;
}
@@ -243,7 +244,8 @@
// 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)
@@ -591,7 +593,7 @@
}
gfx::NativeWindow ExternalTabContainerWin::GetFrameNativeWindow() {
- return hwnd();
+ return GetNativeView();
}
bool ExternalTabContainerWin::TakeFocus(content::WebContents* source,
@@ -943,19 +945,16 @@
////////////////////////////////////////////////////////////////////////////////
// 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();
- }
- return result;
+void ExternalTabContainerWin::HandleCreate() {
+ views::NativeWidgetWin::HandleCreate();
+ // Grab a reference here which will be released in OnFinalMessage
+ AddRef();
}
-void ExternalTabContainerWin::OnDestroy() {
+void ExternalTabContainerWin::HandleDestroying() {
prop_.reset();
Uninitialize();
- NativeWidgetWin::OnDestroy();
+ NativeWidgetWin::HandleDestroying();
}
void ExternalTabContainerWin::OnFinalMessage(HWND window) {

Powered by Google App Engine
This is Rietveld 408576698