| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/extensions/api/streams_private/streams_private_api.h" | 5 #include "chrome/browser/extensions/api/streams_private/streams_private_api.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 13 #include "chrome/browser/extensions/extension_function_registry.h" | |
| 14 #include "chrome/browser/extensions/extension_tab_util.h" | 13 #include "chrome/browser/extensions/extension_tab_util.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/common/extensions/api/streams_private.h" | 15 #include "chrome/common/extensions/api/streams_private.h" |
| 17 #include "content/public/browser/notification_details.h" | 16 #include "content/public/browser/notification_details.h" |
| 18 #include "content/public/browser/notification_source.h" | 17 #include "content/public/browser/notification_source.h" |
| 19 #include "content/public/browser/stream_handle.h" | 18 #include "content/public/browser/stream_handle.h" |
| 20 #include "extensions/browser/event_router.h" | 19 #include "extensions/browser/event_router.h" |
| 20 #include "extensions/browser/extension_function_registry.h" |
| 21 #include "extensions/browser/extension_system.h" | 21 #include "extensions/browser/extension_system.h" |
| 22 | 22 |
| 23 namespace extensions { | 23 namespace extensions { |
| 24 | 24 |
| 25 namespace streams_private = api::streams_private; | 25 namespace streams_private = api::streams_private; |
| 26 | 26 |
| 27 // static | 27 // static |
| 28 StreamsPrivateAPI* StreamsPrivateAPI::Get(content::BrowserContext* context) { | 28 StreamsPrivateAPI* StreamsPrivateAPI::Get(content::BrowserContext* context) { |
| 29 return GetFactoryInstance()->GetForProfile(context); | 29 return GetFactoryInstance()->GetForProfile(context); |
| 30 } | 30 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 void StreamsPrivateAPI::Observe(int type, | 79 void StreamsPrivateAPI::Observe(int type, |
| 80 const content::NotificationSource& source, | 80 const content::NotificationSource& source, |
| 81 const content::NotificationDetails& details) { | 81 const content::NotificationDetails& details) { |
| 82 if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) { | 82 if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) { |
| 83 const Extension* extension = | 83 const Extension* extension = |
| 84 content::Details<const UnloadedExtensionInfo>(details)->extension; | 84 content::Details<const UnloadedExtensionInfo>(details)->extension; |
| 85 streams_.erase(extension->id()); | 85 streams_.erase(extension->id()); |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 } // namespace extensions | 88 } // namespace extensions |
| OLD | NEW |