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 #ifndef CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/extensions/api/dial/dial_device_data.h" | 10 #include "chrome/browser/extensions/api/dial/dial_device_data.h" |
11 #include "chrome/browser/extensions/api/dial/dial_registry.h" | 11 #include "chrome/browser/extensions/api/dial/dial_registry.h" |
12 #include "components/browser_context_keyed_service/refcounted_browser_context_ke
yed_service.h" | 12 #include "components/keyed_service/content/refcounted_browser_context_keyed_serv
ice.h" |
13 #include "extensions/browser/api/async_api_function.h" | 13 #include "extensions/browser/api/async_api_function.h" |
14 #include "extensions/browser/event_router.h" | 14 #include "extensions/browser/event_router.h" |
15 | 15 |
16 namespace extensions { | 16 namespace extensions { |
17 | 17 |
18 class DialRegistry; | 18 class DialRegistry; |
19 | 19 |
20 // Dial API which is a ref-counted BrowserContextKeyedService that manages | 20 // Dial API which is a ref-counted KeyedService that manages |
21 // the DIAL registry. It takes care of creating the registry on the IO thread | 21 // the DIAL registry. It takes care of creating the registry on the IO thread |
22 // and is an observer of the registry. It makes sure devices events are sent out | 22 // and is an observer of the registry. It makes sure devices events are sent out |
23 // to extension listeners on the right thread. | 23 // to extension listeners on the right thread. |
24 class DialAPI : public RefcountedBrowserContextKeyedService, | 24 class DialAPI : public RefcountedBrowserContextKeyedService, |
25 public EventRouter::Observer, | 25 public EventRouter::Observer, |
26 public DialRegistry::Observer { | 26 public DialRegistry::Observer { |
27 public: | 27 public: |
28 explicit DialAPI(Profile* profile); | 28 explicit DialAPI(Profile* profile); |
29 | 29 |
30 // The DialRegistry for the API. This must always be used only from the IO | 30 // The DialRegistry for the API. This must always be used only from the IO |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 bool result_; | 94 bool result_; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(DialDiscoverNowFunction); | 96 DISALLOW_COPY_AND_ASSIGN(DialDiscoverNowFunction); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace api | 99 } // namespace api |
100 | 100 |
101 } // namespace extensions | 101 } // namespace extensions |
102 | 102 |
103 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_H_ | 103 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_H_ |
OLD | NEW |