OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_GLUE_PLUGINS_FAKE_PLUGIN_WINDOW_TRACKER_MAC_H_ |
| 6 #define WEBKIT_GLUE_PLUGINS_FAKE_PLUGIN_WINDOW_TRACKER_MAC_H_ |
| 7 |
| 8 #include <Carbon/Carbon.h> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/scoped_cftyperef.h" |
| 12 |
| 13 class WebPluginDelegateImpl; |
| 14 |
| 15 // Serves as a bridge between password delegate instances and the Carbon |
| 16 // interposing library. The Carbon functions we interpose work in terms of |
| 17 // WindowRefs, and we need to be able to map from those back to the plugin |
| 18 // delegates that know what we should claim about the state of the world. |
| 19 class __attribute__((visibility("default"))) FakePluginWindowTracker { |
| 20 public: |
| 21 FakePluginWindowTracker(); |
| 22 |
| 23 // Returns the shared window tracker instance. |
| 24 static FakePluginWindowTracker* SharedInstance(); |
| 25 |
| 26 // Creates a new fake window ref associated with |delegate|. |
| 27 WindowRef GenerateFakeWindowForDelegate(WebPluginDelegateImpl* delegate); |
| 28 |
| 29 // Returns the WebPluginDelegate associated with the given fake window ref. |
| 30 const WebPluginDelegateImpl* GetDelegateForFakeWindow(WindowRef window) const; |
| 31 |
| 32 // Removes the fake window ref entry for |delegate|. |
| 33 void RemoveFakeWindowForDelegate(WebPluginDelegateImpl* delegate, |
| 34 WindowRef window); |
| 35 |
| 36 private: |
| 37 scoped_cftyperef<CFMutableDictionaryRef> window_to_delegate_map_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(FakePluginWindowTracker); |
| 40 }; |
| 41 |
| 42 #endif // WEBKIT_GLUE_PLUGINS_FAKE_PLUGIN_WINDOW_TRACKER_MAC_H_ |
OLD | NEW |