OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
8 #include "app/gfx/native_theme_win.h" | 8 #include "app/gfx/native_theme_win.h" |
9 #include "app/gfx/path.h" | 9 #include "app/gfx/path.h" |
10 #include "app/l10n_util_win.h" | 10 #include "app/l10n_util_win.h" |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 void WidgetWin::OnClose() { | 464 void WidgetWin::OnClose() { |
465 Close(); | 465 Close(); |
466 } | 466 } |
467 | 467 |
468 void WidgetWin::OnCommand(UINT notification_code, int command_id, HWND window) { | 468 void WidgetWin::OnCommand(UINT notification_code, int command_id, HWND window) { |
469 SetMsgHandled(FALSE); | 469 SetMsgHandled(FALSE); |
470 } | 470 } |
471 | 471 |
472 LRESULT WidgetWin::OnCreate(CREATESTRUCT* create_struct) { | 472 LRESULT WidgetWin::OnCreate(CREATESTRUCT* create_struct) { |
473 SetNativeWindowProperty(kWidgetKey, this); | 473 // Widget::GetWidgetFromNativeView expects the contents of this property |
| 474 // to be of type Widget, so the cast is necessary. |
| 475 SetNativeWindowProperty(kWidgetKey, static_cast<Widget*>(this)); |
474 return 0; | 476 return 0; |
475 } | 477 } |
476 | 478 |
477 void WidgetWin::OnDestroy() { | 479 void WidgetWin::OnDestroy() { |
478 SetNativeWindowProperty(kWidgetKey, NULL); | 480 SetNativeWindowProperty(kWidgetKey, NULL); |
479 | 481 |
480 if (drop_target_.get()) { | 482 if (drop_target_.get()) { |
481 RevokeDragDrop(hwnd()); | 483 RevokeDragDrop(hwnd()); |
482 drop_target_ = NULL; | 484 drop_target_ = NULL; |
483 } | 485 } |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 } | 1217 } |
1216 return NULL; | 1218 return NULL; |
1217 } | 1219 } |
1218 | 1220 |
1219 // static | 1221 // static |
1220 Widget* Widget::GetWidgetFromNativeWindow(gfx::NativeWindow native_window) { | 1222 Widget* Widget::GetWidgetFromNativeWindow(gfx::NativeWindow native_window) { |
1221 return Widget::GetWidgetFromNativeView(native_window); | 1223 return Widget::GetWidgetFromNativeView(native_window); |
1222 } | 1224 } |
1223 | 1225 |
1224 } // namespace views | 1226 } // namespace views |
OLD | NEW |