OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 profiler_(&service_locator_), | 103 profiler_(&service_locator_), |
104 main_thread_task_poster_(&service_locator_, npp), | 104 main_thread_task_poster_(&service_locator_, npp), |
105 fullscreen_(false), | 105 fullscreen_(false), |
106 renderer_(NULL), | 106 renderer_(NULL), |
107 features_(NULL), | 107 features_(NULL), |
108 fullscreen_region_valid_(false), | 108 fullscreen_region_valid_(false), |
109 renderer_init_status_(Renderer::UNINITIALIZED), | 109 renderer_init_status_(Renderer::UNINITIALIZED), |
110 pending_ticks_(0), | 110 pending_ticks_(0), |
111 #ifdef OS_WIN | 111 #ifdef OS_WIN |
112 hWnd_(NULL), | 112 hWnd_(NULL), |
113 fullscreen_hWnd_(NULL), | |
114 parent_hWnd_(NULL), | |
115 plugin_hWnd_(NULL), | 113 plugin_hWnd_(NULL), |
116 default_plugin_window_proc_(NULL), | 114 content_hWnd_(NULL), |
117 got_dblclick_(false), | 115 got_dblclick_(false), |
118 painted_once_(false), | 116 painted_once_(false), |
119 #endif | 117 #endif |
120 #ifdef OS_MACOSX | 118 #ifdef OS_MACOSX |
121 mac_fullscreen_state_(NULL), | 119 mac_fullscreen_state_(NULL), |
122 renderer_is_software_(false), | 120 renderer_is_software_(false), |
123 scroll_is_in_progress_(false), | 121 scroll_is_in_progress_(false), |
124 drawing_model_(NPDrawingModelQuickDraw), | 122 drawing_model_(NPDrawingModelQuickDraw), |
125 event_model_(NPEventModelCarbon), | 123 event_model_(NPEventModelCarbon), |
126 mac_window_(0), | 124 mac_window_(0), |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 PlatformSpecificSetCursor(); | 734 PlatformSpecificSetCursor(); |
737 } | 735 } |
738 | 736 |
739 #ifdef OS_WIN | 737 #ifdef OS_WIN |
740 static const wchar_t* kWindowPropertyName = L"o3d"; | 738 static const wchar_t* kWindowPropertyName = L"o3d"; |
741 | 739 |
742 void PluginObject::StorePluginProperty(HWND hWnd, PluginObject *obj) { | 740 void PluginObject::StorePluginProperty(HWND hWnd, PluginObject *obj) { |
743 if (obj->GetHWnd()) { // Clear out the record from the old window first. | 741 if (obj->GetHWnd()) { // Clear out the record from the old window first. |
744 ClearPluginProperty(obj->GetHWnd()); | 742 ClearPluginProperty(obj->GetHWnd()); |
745 } | 743 } |
| 744 obj->SetHWnd(hWnd); |
746 StorePluginPropertyUnsafe(hWnd, obj); | 745 StorePluginPropertyUnsafe(hWnd, obj); |
747 } | 746 } |
748 | 747 |
749 void PluginObject::StorePluginPropertyUnsafe(HWND hWnd, PluginObject *obj) { | 748 void PluginObject::StorePluginPropertyUnsafe(HWND hWnd, PluginObject *obj) { |
750 obj->SetHWnd(hWnd); | |
751 if (hWnd) { | 749 if (hWnd) { |
752 SetProp(hWnd, kWindowPropertyName, static_cast<HANDLE>(obj)); | 750 SetProp(hWnd, kWindowPropertyName, static_cast<HANDLE>(obj)); |
753 ::DragAcceptFiles(hWnd, true); | 751 ::DragAcceptFiles(hWnd, true); |
754 } | 752 } |
755 } | 753 } |
756 | 754 |
757 PluginObject *PluginObject::GetPluginProperty(HWND hWnd) { | 755 PluginObject *PluginObject::GetPluginProperty(HWND hWnd) { |
758 return static_cast<PluginObject*>(GetProp(hWnd, kWindowPropertyName)); | 756 return static_cast<PluginObject*>(GetProp(hWnd, kWindowPropertyName)); |
759 } | 757 } |
760 | 758 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 PluginObject *plugin_object = static_cast<PluginObject *>(npp->pdata); | 908 PluginObject *plugin_object = static_cast<PluginObject *>(npp->pdata); |
911 if (plugin_object) { // May not be initialized yet. | 909 if (plugin_object) { // May not be initialized yet. |
912 return plugin_object->client()->ProfileToString(); | 910 return plugin_object->client()->ProfileToString(); |
913 } else { | 911 } else { |
914 return ""; | 912 return ""; |
915 } | 913 } |
916 } | 914 } |
917 | 915 |
918 } // namespace globals | 916 } // namespace globals |
919 } // namespace glue | 917 } // namespace glue |
OLD | NEW |