| 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 <Carbon/Carbon.h> | 5 #include <Carbon/Carbon.h> |
| 6 | 6 |
| 7 #include "base/gfx/rect.h" | 7 #include "base/gfx/rect.h" |
| 8 #include "webkit/glue/plugins/fake_plugin_window_tracker_mac.h" | 8 #include "webkit/glue/plugins/fake_plugin_window_tracker_mac.h" |
| 9 | 9 |
| 10 namespace webkit_glue { | 10 namespace webkit_glue { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 | 132 |
| 133 static void ChromePluginHideWindow(WindowRef window) { | 133 static void ChromePluginHideWindow(WindowRef window) { |
| 134 CGWindowID window_id = HIWindowGetCGWindowID(window); | 134 CGWindowID window_id = HIWindowGetCGWindowID(window); |
| 135 CGRect window_rect = CGRectForWindow(window); | 135 CGRect window_rect = CGRectForWindow(window); |
| 136 HideWindow(window); | 136 HideWindow(window); |
| 137 webkit_glue::NotifyBrowserOfPluginHideWindow(window_id, window_rect); | 137 webkit_glue::NotifyBrowserOfPluginHideWindow(window_id, window_rect); |
| 138 MaybeReactivateSavedProcess(); | 138 MaybeReactivateSavedProcess(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 static void ChromePluginDisposeDialog(DialogRef dialog) { |
| 142 WindowRef window = GetDialogWindow(dialog); |
| 143 CGWindowID window_id = HIWindowGetCGWindowID(window); |
| 144 CGRect window_rect = CGRectForWindow(window); |
| 145 DisposeDialog(dialog); |
| 146 webkit_glue::NotifyBrowserOfPluginDisposeWindow(window_id, window_rect); |
| 147 MaybeReactivateSavedProcess(); |
| 148 } |
| 149 |
| 141 #pragma mark - | 150 #pragma mark - |
| 142 | 151 |
| 143 struct interpose_substitution { | 152 struct interpose_substitution { |
| 144 const void* replacement; | 153 const void* replacement; |
| 145 const void* original; | 154 const void* original; |
| 146 }; | 155 }; |
| 147 | 156 |
| 148 #define INTERPOSE_FUNCTION(function) \ | 157 #define INTERPOSE_FUNCTION(function) \ |
| 149 { reinterpret_cast<const void*>(ChromePlugin##function), \ | 158 { reinterpret_cast<const void*>(ChromePlugin##function), \ |
| 150 reinterpret_cast<const void*>(function) } | 159 reinterpret_cast<const void*>(function) } |
| 151 | 160 |
| 152 __attribute__((used)) static const interpose_substitution substitutions[] | 161 __attribute__((used)) static const interpose_substitution substitutions[] |
| 153 __attribute__((section("__DATA, __interpose"))) = { | 162 __attribute__((section("__DATA, __interpose"))) = { |
| 154 INTERPOSE_FUNCTION(IsWindowHilited), | 163 INTERPOSE_FUNCTION(IsWindowHilited), |
| 155 INTERPOSE_FUNCTION(SelectWindow), | 164 INTERPOSE_FUNCTION(SelectWindow), |
| 156 INTERPOSE_FUNCTION(ShowWindow), | 165 INTERPOSE_FUNCTION(ShowWindow), |
| 157 INTERPOSE_FUNCTION(DisposeWindow), | 166 INTERPOSE_FUNCTION(DisposeWindow), |
| 158 INTERPOSE_FUNCTION(HideWindow), | 167 INTERPOSE_FUNCTION(HideWindow), |
| 168 INTERPOSE_FUNCTION(DisposeDialog), |
| 159 }; | 169 }; |
| OLD | NEW |