| 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 "chrome/renderer/extensions/event_bindings.h" | 5 #include "chrome/renderer/extensions/event_bindings.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 std::string event_name(*v8::String::AsciiValue(args[0])); | 119 std::string event_name(*v8::String::AsciiValue(args[0])); |
| 120 if (--listener_counts[event_name] == 0) { | 120 if (--listener_counts[event_name] == 0) { |
| 121 content::RenderThread::Get()->Send( | 121 content::RenderThread::Get()->Send( |
| 122 new ExtensionHostMsg_RemoveListener(context->extension_id(), | 122 new ExtensionHostMsg_RemoveListener(context->extension_id(), |
| 123 event_name)); | 123 event_name)); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 return v8::Undefined(); | 127 return v8::Undefined(); |
| 128 } | 128 } |
| 129 |
| 129 }; | 130 }; |
| 130 | 131 |
| 131 } // namespace | 132 } // namespace |
| 132 | 133 |
| 133 v8::Extension* EventBindings::Get(ExtensionDispatcher* dispatcher) { | 134 v8::Extension* EventBindings::Get(ExtensionDispatcher* dispatcher) { |
| 134 static v8::Extension* extension = new ExtensionImpl(dispatcher); | 135 static v8::Extension* extension = new ExtensionImpl(dispatcher); |
| 135 return extension; | 136 return extension; |
| 136 } | 137 } |
| OLD | NEW |