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

Side by Side Diff: views/widget/widget_win.cc

Issue 6880201: Scrap WNDCLASSEX.hCursor, update GetCursorForPoint, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nix WindowWin cursors; only SetCuror on client events; add RootView::UpdateCursor Win arrow default. Created 9 years, 7 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/widget/widget_win.h" 5 #include "views/widget/widget_win.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/win/windows_version.h" 10 #include "base/win/windows_version.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 active_mouse_tracking_flags_(0), 138 active_mouse_tracking_flags_(0),
139 use_layered_buffer_(false), 139 use_layered_buffer_(false),
140 layered_alpha_(255), 140 layered_alpha_(255),
141 ALLOW_THIS_IN_INITIALIZER_LIST(paint_layered_window_factory_(this)), 141 ALLOW_THIS_IN_INITIALIZER_LIST(paint_layered_window_factory_(this)),
142 delete_on_destroy_(true), 142 delete_on_destroy_(true),
143 can_update_layered_window_(true), 143 can_update_layered_window_(true),
144 is_window_(false), 144 is_window_(false),
145 restore_focus_when_enabled_(false), 145 restore_focus_when_enabled_(false),
146 accessibility_view_events_index_(-1), 146 accessibility_view_events_index_(-1),
147 accessibility_view_events_(kMaxAccessibilityViewEvents), 147 accessibility_view_events_(kMaxAccessibilityViewEvents),
148 previous_cursor_(NULL),
149 is_input_method_win_(false) { 148 is_input_method_win_(false) {
150 set_native_widget(this); 149 set_native_widget(this);
151 } 150 }
152 151
153 WidgetWin::~WidgetWin() { 152 WidgetWin::~WidgetWin() {
154 // We need to delete the input method before calling DestroyRootView(), 153 // We need to delete the input method before calling DestroyRootView(),
155 // because it'll set focus_manager_ to NULL. 154 // because it'll set focus_manager_ to NULL.
156 input_method_.reset(); 155 input_method_.reset();
157 DestroyRootView(); 156 DestroyRootView();
158 } 157 }
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 &WidgetWin::RedrawLayeredWindowContents)); 484 &WidgetWin::RedrawLayeredWindowContents));
486 } 485 }
487 } else { 486 } else {
488 // InvalidateRect() expects client coordinates. 487 // InvalidateRect() expects client coordinates.
489 RECT r = rect.ToRECT(); 488 RECT r = rect.ToRECT();
490 InvalidateRect(hwnd(), &r, FALSE); 489 InvalidateRect(hwnd(), &r, FALSE);
491 } 490 }
492 } 491 }
493 492
494 void WidgetWin::SetCursor(gfx::NativeCursor cursor) { 493 void WidgetWin::SetCursor(gfx::NativeCursor cursor) {
495 if (cursor) { 494 ::SetCursor(cursor);
496 previous_cursor_ = ::SetCursor(cursor);
497 } else if (previous_cursor_) {
498 ::SetCursor(previous_cursor_);
499 previous_cursor_ = NULL;
500 }
501 } 495 }
502 496
503 void WidgetWin::NotifyAccessibilityEvent( 497 void WidgetWin::NotifyAccessibilityEvent(
504 View* view, 498 View* view,
505 ui::AccessibilityTypes::Event event_type, 499 ui::AccessibilityTypes::Event event_type,
506 bool send_native_event) { 500 bool send_native_event) {
507 // Send the notification to the delegate. 501 // Send the notification to the delegate.
508 if (ViewsDelegate::views_delegate) 502 if (ViewsDelegate::views_delegate)
509 ViewsDelegate::views_delegate->NotifyAccessibilityEvent(view, event_type); 503 ViewsDelegate::views_delegate->NotifyAccessibilityEvent(view, event_type);
510 504
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 1230
1237 // And now, notify them that they have a brand new parent. 1231 // And now, notify them that they have a brand new parent.
1238 for (NativeWidgets::iterator it = widgets.begin(); 1232 for (NativeWidgets::iterator it = widgets.begin();
1239 it != widgets.end(); ++it) { 1233 it != widgets.end(); ++it) {
1240 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, 1234 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true,
1241 new_parent); 1235 new_parent);
1242 } 1236 }
1243 } 1237 }
1244 1238
1245 } // namespace views 1239 } // namespace views
OLDNEW
« views/view.h ('K') | « views/widget/widget_win.h ('k') | views/window/window_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698