| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "extensions/renderer/api_event_handler.h" | 5 #include "extensions/renderer/bindings/api_event_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/supports_user_data.h" | 15 #include "base/supports_user_data.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "content/public/child/v8_value_converter.h" | 17 #include "content/public/child/v8_value_converter.h" |
| 18 #include "extensions/renderer/api_event_listeners.h" | 18 #include "extensions/renderer/bindings/api_event_listeners.h" |
| 19 #include "extensions/renderer/event_emitter.h" | 19 #include "extensions/renderer/bindings/event_emitter.h" |
| 20 #include "gin/handle.h" | 20 #include "gin/handle.h" |
| 21 #include "gin/per_context_data.h" | 21 #include "gin/per_context_data.h" |
| 22 | 22 |
| 23 namespace extensions { | 23 namespace extensions { |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 void DoNothingOnListenersChanged(binding::EventListenersChanged change, | 27 void DoNothingOnListenersChanged(binding::EventListenersChanged change, |
| 28 const base::DictionaryValue* filter, | 28 const base::DictionaryValue* filter, |
| 29 bool was_manual, | 29 bool was_manual, |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 auto iter = data->emitters.find(event_name); | 326 auto iter = data->emitters.find(event_name); |
| 327 DCHECK(iter != data->emitters.end()); | 327 DCHECK(iter != data->emitters.end()); |
| 328 EventEmitter* emitter = nullptr; | 328 EventEmitter* emitter = nullptr; |
| 329 gin::Converter<EventEmitter*>::FromV8( | 329 gin::Converter<EventEmitter*>::FromV8( |
| 330 context->GetIsolate(), iter->second.Get(context->GetIsolate()), &emitter); | 330 context->GetIsolate(), iter->second.Get(context->GetIsolate()), &emitter); |
| 331 CHECK(emitter); | 331 CHECK(emitter); |
| 332 return emitter->GetNumListeners(); | 332 return emitter->GetNumListeners(); |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace extensions | 335 } // namespace extensions |
| OLD | NEW |