Index: views/widget/widget_win.cc |
=================================================================== |
--- views/widget/widget_win.cc (revision 23410) |
+++ views/widget/widget_win.cc (working copy) |
@@ -27,7 +27,7 @@ |
static const wchar_t* const kRootViewWindowProperty = L"__ROOT_VIEW__"; |
bool SetRootViewForHWND(HWND hwnd, RootView* root_view) { |
- return SetProp(hwnd, kRootViewWindowProperty, root_view) ? true : false; |
+ return ::SetProp(hwnd, kRootViewWindowProperty, root_view) ? true : false; |
} |
RootView* GetRootViewForHWND(HWND hwnd) { |
@@ -36,7 +36,7 @@ |
NativeControlWin* GetNativeControlWinForHWND(HWND hwnd) { |
return reinterpret_cast<NativeControlWin*>( |
- GetProp(hwnd, NativeControlWin::kNativeControlWinKey)); |
+ ::GetProp(hwnd, NativeControlWin::kNativeControlWinKey)); |
} |
/////////////////////////////////////////////////////////////////////////////// |
@@ -77,7 +77,7 @@ |
default_theme_provider_.reset(new DefaultThemeProvider()); |
- SetWindowSupportsRerouteMouseWheel(hwnd()); |
+ SetWindowSupportsRerouteMouseWheel(GetNativeView()); |
drop_target_ = new DropTargetWin(root_view_.get()); |
@@ -87,7 +87,7 @@ |
} |
// Sets the RootView as a property, so the automation can introspect windows. |
- SetRootViewForHWND(hwnd(), root_view_.get()); |
+ SetRootViewForHWND(GetNativeView(), root_view_.get()); |
MessageLoopForUI::current()->AddObserver(this); |
@@ -102,14 +102,14 @@ |
// This message initializes the window so that focus border are shown for |
// windows. |
- SendMessage(hwnd(), |
- WM_CHANGEUISTATE, |
- MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS), |
- 0); |
+ ::SendMessage(GetNativeView(), |
+ WM_CHANGEUISTATE, |
+ MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS), |
+ 0); |
// Bug 964884: detach the IME attached to this window. |
// We should attach IMEs only when we need to input CJK strings. |
- ImmAssociateContextEx(hwnd(), NULL, 0); |
+ ::ImmAssociateContextEx(GetNativeView(), NULL, 0); |
} |
void WidgetWin::SetContentsView(View* view) { |
@@ -126,7 +126,7 @@ |
GetClientRect(&crect); |
POINT p = {0, 0}; |
- ClientToScreen(hwnd(), &p); |
+ ::ClientToScreen(GetNativeView(), &p); |
out->SetRect(crect.left + p.x, crect.top + p.y, |
crect.Width(), crect.Height()); |
} |
@@ -164,7 +164,7 @@ |
// we need to check to see if we're still a window before trying to destroy |
// ourself. |
if (IsWindow()) |
- DestroyWindow(hwnd()); |
+ DestroyWindow(); |
} |
void WidgetWin::Show() { |
@@ -185,7 +185,7 @@ |
} |
gfx::NativeView WidgetWin::GetNativeView() const { |
- return WindowImpl::hwnd(); |
+ return WindowImpl::GetNativeView(); |
} |
static BOOL CALLBACK EnumChildProcForRedraw(HWND hwnd, LPARAM lparam) { |
@@ -212,10 +212,10 @@ |
// We're transparent. Need to force painting to occur from our parent. |
CRect parent_update_rect = update_rect.ToRECT(); |
POINT location_in_parent = { 0, 0 }; |
- ClientToScreen(hwnd(), &location_in_parent); |
- ScreenToClient(GetParent(), &location_in_parent); |
+ ClientToScreen(GetNativeView(), &location_in_parent); |
+ ::ScreenToClient(GetParent(), &location_in_parent); |
parent_update_rect.OffsetRect(location_in_parent); |
- RedrawWindow(GetParent(), parent_update_rect, NULL, |
+ ::RedrawWindow(GetParent(), parent_update_rect, NULL, |
RDW_UPDATENOW | RDW_INVALIDATE | RDW_ALLCHILDREN); |
} else { |
// Paint child windows that are in a different process asynchronously. |
@@ -230,11 +230,11 @@ |
gfx::Rect invalid_screen_rect = update_rect; |
invalid_screen_rect.Offset(screen_rect.x(), screen_rect.y()); |
- RedrawWindow(hwnd(), &update_rect.ToRECT(), NULL, |
- RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOCHILDREN); |
+ ::RedrawWindow(GetNativeView(), &update_rect.ToRECT(), NULL, |
+ RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOCHILDREN); |
LPARAM lparam = reinterpret_cast<LPARAM>(&invalid_screen_rect); |
- EnumChildWindows(hwnd(), EnumChildProcForRedraw, lparam); |
+ EnumChildWindows(GetNativeView(), EnumChildProcForRedraw, lparam); |
} |
// As we were created with a style of WS_CLIPCHILDREN redraw requests may |
// result in an empty paint rect in WM_PAINT (this'll happen if a |
@@ -261,15 +261,15 @@ |
Widget* WidgetWin::GetRootWidget() const { |
return reinterpret_cast<WidgetWin*>( |
- win_util::GetWindowUserData(GetAncestor(hwnd(), GA_ROOT))); |
+ win_util::GetWindowUserData(GetAncestor(GetNativeView(), GA_ROOT))); |
} |
bool WidgetWin::IsVisible() const { |
- return !!::IsWindowVisible(hwnd()); |
+ return !!::IsWindowVisible(GetNativeView()); |
} |
bool WidgetWin::IsActive() const { |
- return win_util::IsWindowActive(hwnd()); |
+ return win_util::IsWindowActive(GetNativeView()); |
} |
void WidgetWin::GenerateMousePressedForView(View* view, |
@@ -301,11 +301,11 @@ |
} |
Window* WidgetWin::GetWindow() { |
- return GetWindowImpl(hwnd()); |
+ return GetWindowImpl(GetNativeView()); |
} |
const Window* WidgetWin::GetWindow() const { |
- return GetWindowImpl(hwnd()); |
+ return GetWindowImpl(GetNativeView()); |
} |
FocusManager* WidgetWin::GetFocusManager() { |
@@ -332,7 +332,7 @@ |
return; |
use_layered_buffer_ = use_layered_buffer; |
- if (!hwnd()) |
+ if (!GetNativeView()) |
return; |
if (use_layered_buffer_) { |
@@ -440,11 +440,11 @@ |
void WidgetWin::OnDestroy() { |
if (drop_target_.get()) { |
- RevokeDragDrop(hwnd()); |
+ RevokeDragDrop(GetNativeView()); |
drop_target_ = NULL; |
} |
- RemoveProp(hwnd(), kRootViewWindowProperty); |
+ RemoveProp(GetNativeView(), kRootViewWindowProperty); |
} |
LRESULT WidgetWin::OnEraseBkgnd(HDC dc) { |
@@ -548,7 +548,7 @@ |
// Reroute the mouse-wheel to the window under the mouse pointer if |
// applicable. |
if (message == WM_MOUSEWHEEL && |
- views::RerouteMouseWheel(hwnd(), w_param, l_param)) { |
+ views::RerouteMouseWheel(GetNativeView(), w_param, l_param)) { |
return 0; |
} |
@@ -598,7 +598,7 @@ |
LRESULT WidgetWin::OnNCMouseMove(UINT flags, const CPoint& point) { |
// NC points are in screen coordinates. |
CPoint temp = point; |
- MapWindowPoints(HWND_DESKTOP, hwnd(), &temp, 1); |
+ MapWindowPoints(HWND_DESKTOP, GetNativeView(), &temp, 1); |
ProcessMouseMoved(temp, 0, true); |
// We need to process this message to stop Windows from drawing the window |
@@ -634,7 +634,7 @@ |
} |
void WidgetWin::OnPaint(HDC dc) { |
- root_view_->OnPaint(hwnd()); |
+ root_view_->OnPaint(GetNativeView()); |
} |
void WidgetWin::OnRButtonDown(UINT flags, const CPoint& point) { |
@@ -681,7 +681,7 @@ |
TRACKMOUSEEVENT tme; |
tme.cbSize = sizeof(tme); |
tme.dwFlags = mouse_tracking_flags; |
- tme.hwndTrack = hwnd(); |
+ tme.hwndTrack = GetNativeView(); |
tme.dwHoverTime = 0; |
TrackMouseEvent(&tme); |
} else if (mouse_tracking_flags != active_mouse_tracking_flags_) { |
@@ -848,8 +848,8 @@ |
CPoint window_position = wr.TopLeft(); |
BLENDFUNCTION blend = {AC_SRC_OVER, 0, layered_alpha_, AC_SRC_ALPHA}; |
- UpdateLayeredWindow( |
- hwnd(), NULL, &window_position, &size, dib_dc, &zero_origin, |
+ ::UpdateLayeredWindow( |
+ GetNativeView(), NULL, &window_position, &size, dib_dc, &zero_origin, |
RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA); |
} |
} |
@@ -904,7 +904,7 @@ |
} |
LRESULT WidgetWin::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) { |
- HWND window = hwnd(); |
+ HWND window = GetNativeView(); |
LRESULT result = 0; |
// First allow messages sent by child controls to be processed directly by |