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_TABS_TABS_WINDOWS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
9 #include "chrome/browser/extensions/event_router.h" | 10 #include "chrome/browser/extensions/event_router.h" |
10 #include "chrome/browser/profiles/profile_keyed_service.h" | 11 #include "chrome/browser/profiles/profile_keyed_service.h" |
11 | 12 |
12 namespace extensions { | 13 namespace extensions { |
13 class WindowsEventRouter; | 14 class WindowsEventRouter; |
14 | 15 |
15 class TabsWindowsAPI : public ProfileKeyedService, | 16 class TabsWindowsAPI : public ProfileKeyedService, |
16 public extensions::EventRouter::Observer { | 17 public extensions::EventRouter::Observer { |
17 public: | 18 public: |
18 explicit TabsWindowsAPI(Profile* profile); | 19 explicit TabsWindowsAPI(Profile* profile); |
(...skipping 10 matching lines...) Expand all Loading... |
29 // EventRouter::Observer implementation. | 30 // EventRouter::Observer implementation. |
30 virtual void OnListenerAdded(const extensions::EventListenerInfo& details) | 31 virtual void OnListenerAdded(const extensions::EventListenerInfo& details) |
31 OVERRIDE; | 32 OVERRIDE; |
32 | 33 |
33 private: | 34 private: |
34 Profile* profile_; | 35 Profile* profile_; |
35 | 36 |
36 scoped_ptr<WindowsEventRouter> windows_event_router_; | 37 scoped_ptr<WindowsEventRouter> windows_event_router_; |
37 }; | 38 }; |
38 | 39 |
| 40 template <> |
| 41 struct ProfileKeyedAPIFactoryTraits<TabsWindowsAPI> |
| 42 : public DefaultProfileKeyedAPIFactoryTraits { |
| 43 static const char* name() { |
| 44 return "TabsWindowsAPI"; |
| 45 } |
| 46 |
| 47 static const bool kServiceIsNULLWhileTesting = true; |
| 48 }; |
| 49 |
39 } // namespace extensions | 50 } // namespace extensions |
40 | 51 |
41 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_ | 52 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_ |
OLD | NEW |