| 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 "content/plugin/plugin_interpose_util_mac.h" | 5 #include "content/plugin/plugin_interpose_util_mac.h" |
| 6 | 6 |
| 7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
| 8 #import <objc/runtime.h> | 8 #import <objc/runtime.h> |
| 9 | 9 |
| 10 #include "content/common/plugin_messages.h" | 10 #include "content/common/plugin_messages.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace mac_plugin_interposing | 82 } // namespace mac_plugin_interposing |
| 83 | 83 |
| 84 #pragma mark - | 84 #pragma mark - |
| 85 | 85 |
| 86 struct WindowInfo { | 86 struct WindowInfo { |
| 87 uint32 window_id; | 87 uint32 window_id; |
| 88 CGRect bounds; | 88 CGRect bounds; |
| 89 WindowInfo(NSWindow* window) { | 89 explicit WindowInfo(NSWindow* window) { |
| 90 NSInteger window_num = [window windowNumber]; | 90 NSInteger window_num = [window windowNumber]; |
| 91 window_id = window_num > 0 ? window_num : 0; | 91 window_id = window_num > 0 ? window_num : 0; |
| 92 bounds = NSRectToCGRect([window frame]); | 92 bounds = NSRectToCGRect([window frame]); |
| 93 } | 93 } |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 static void OnPluginWindowClosed(const WindowInfo& window_info) { | 96 static void OnPluginWindowClosed(const WindowInfo& window_info) { |
| 97 if (window_info.window_id == 0) | 97 if (window_info.window_id == 0) |
| 98 return; | 98 return; |
| 99 mac_plugin_interposing::NotifyBrowserOfPluginHideWindow(window_info.window_id, | 99 mac_plugin_interposing::NotifyBrowserOfPluginHideWindow(window_info.window_id, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 Class nscursor_class = [NSCursor class]; | 268 Class nscursor_class = [NSCursor class]; |
| 269 ExchangeMethods(nscursor_class, NO, @selector(set), | 269 ExchangeMethods(nscursor_class, NO, @selector(set), |
| 270 @selector(chromePlugin_set)); | 270 @selector(chromePlugin_set)); |
| 271 ExchangeMethods(nscursor_class, YES, @selector(hide), | 271 ExchangeMethods(nscursor_class, YES, @selector(hide), |
| 272 @selector(chromePlugin_hide)); | 272 @selector(chromePlugin_hide)); |
| 273 ExchangeMethods(nscursor_class, YES, @selector(unhide), | 273 ExchangeMethods(nscursor_class, YES, @selector(unhide), |
| 274 @selector(chromePlugin_unhide)); | 274 @selector(chromePlugin_unhide)); |
| 275 } | 275 } |
| 276 | 276 |
| 277 } // namespace mac_plugin_interposing | 277 } // namespace mac_plugin_interposing |
| OLD | NEW |