| OLD | NEW |
| 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 Loading... |
| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 &WidgetWin::RedrawLayeredWindowContents)); | 427 &WidgetWin::RedrawLayeredWindowContents)); |
| 429 } | 428 } |
| 430 } else { | 429 } else { |
| 431 // InvalidateRect() expects client coordinates. | 430 // InvalidateRect() expects client coordinates. |
| 432 RECT r = rect.ToRECT(); | 431 RECT r = rect.ToRECT(); |
| 433 InvalidateRect(hwnd(), &r, FALSE); | 432 InvalidateRect(hwnd(), &r, FALSE); |
| 434 } | 433 } |
| 435 } | 434 } |
| 436 | 435 |
| 437 void WidgetWin::SetCursor(gfx::NativeCursor cursor) { | 436 void WidgetWin::SetCursor(gfx::NativeCursor cursor) { |
| 438 if (cursor) { | 437 ::SetCursor(cursor); |
| 439 previous_cursor_ = ::SetCursor(cursor); | |
| 440 } else if (previous_cursor_) { | |
| 441 ::SetCursor(previous_cursor_); | |
| 442 previous_cursor_ = NULL; | |
| 443 } | |
| 444 } | 438 } |
| 445 | 439 |
| 446 void WidgetWin::NotifyAccessibilityEvent( | 440 void WidgetWin::NotifyAccessibilityEvent( |
| 447 View* view, | 441 View* view, |
| 448 ui::AccessibilityTypes::Event event_type, | 442 ui::AccessibilityTypes::Event event_type, |
| 449 bool send_native_event) { | 443 bool send_native_event) { |
| 450 // Send the notification to the delegate. | 444 // Send the notification to the delegate. |
| 451 if (ViewsDelegate::views_delegate) | 445 if (ViewsDelegate::views_delegate) |
| 452 ViewsDelegate::views_delegate->NotifyAccessibilityEvent(view, event_type); | 446 ViewsDelegate::views_delegate->NotifyAccessibilityEvent(view, event_type); |
| 453 | 447 |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 | 1224 |
| 1231 // And now, notify them that they have a brand new parent. | 1225 // And now, notify them that they have a brand new parent. |
| 1232 for (NativeWidgets::iterator it = widgets.begin(); | 1226 for (NativeWidgets::iterator it = widgets.begin(); |
| 1233 it != widgets.end(); ++it) { | 1227 it != widgets.end(); ++it) { |
| 1234 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, | 1228 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, |
| 1235 new_parent); | 1229 new_parent); |
| 1236 } | 1230 } |
| 1237 } | 1231 } |
| 1238 | 1232 |
| 1239 } // namespace views | 1233 } // namespace views |
| OLD | NEW |