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/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/extensions/extension_tab_util.h" | 9 #include "chrome/browser/extensions/extension_tab_util.h" |
10 #include "chrome/common/extensions/api/streams_private.h" | 10 #include "chrome/common/extensions/api/streams_private.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 namespace streams_private = api::streams_private; | 43 namespace streams_private = api::streams_private; |
44 | 44 |
45 // static | 45 // static |
46 StreamsPrivateAPI* StreamsPrivateAPI::Get(content::BrowserContext* context) { | 46 StreamsPrivateAPI* StreamsPrivateAPI::Get(content::BrowserContext* context) { |
47 return GetFactoryInstance()->Get(context); | 47 return GetFactoryInstance()->Get(context); |
48 } | 48 } |
49 | 49 |
50 StreamsPrivateAPI::StreamsPrivateAPI(content::BrowserContext* context) | 50 StreamsPrivateAPI::StreamsPrivateAPI(content::BrowserContext* context) |
51 : browser_context_(context), | 51 : browser_context_(context), |
52 weak_ptr_factory_(this), | 52 extension_registry_observer_(this), |
53 extension_registry_observer_(this) { | 53 weak_ptr_factory_(this) { |
54 extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_)); | 54 extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_)); |
55 } | 55 } |
56 | 56 |
57 StreamsPrivateAPI::~StreamsPrivateAPI() { | 57 StreamsPrivateAPI::~StreamsPrivateAPI() { |
58 } | 58 } |
59 | 59 |
60 void StreamsPrivateAPI::ExecuteMimeTypeHandler( | 60 void StreamsPrivateAPI::ExecuteMimeTypeHandler( |
61 const std::string& extension_id, | 61 const std::string& extension_id, |
62 content::WebContents* web_contents, | 62 content::WebContents* web_contents, |
63 scoped_ptr<content::StreamHandle> stream, | 63 scoped_ptr<content::StreamHandle> stream, |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> > | 140 static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> > |
141 g_factory = LAZY_INSTANCE_INITIALIZER; | 141 g_factory = LAZY_INSTANCE_INITIALIZER; |
142 | 142 |
143 // static | 143 // static |
144 BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* | 144 BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* |
145 StreamsPrivateAPI::GetFactoryInstance() { | 145 StreamsPrivateAPI::GetFactoryInstance() { |
146 return g_factory.Pointer(); | 146 return g_factory.Pointer(); |
147 } | 147 } |
148 | 148 |
149 } // namespace extensions | 149 } // namespace extensions |
OLD | NEW |