/chromium-webcl/src/chrome/browser/extensions/api/tabs/tabs_windows_api.h

https://bitbucket.org/peixuan/chromium_r197479_base · C Header · 53 lines · 30 code · 15 blank · 8 comment · 0 complexity · 4ee98b0789be44b60465e7c13a7fab0a MD5 · raw file

  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
  3. // found in the LICENSE file.
  4. #ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_
  5. #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_
  6. #include "base/memory/scoped_ptr.h"
  7. #include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
  8. #include "chrome/browser/extensions/event_router.h"
  9. #include "chrome/browser/profiles/profile_keyed_service.h"
  10. namespace extensions {
  11. class WindowsEventRouter;
  12. class TabsWindowsAPI : public ProfileKeyedAPI,
  13. public extensions::EventRouter::Observer {
  14. public:
  15. explicit TabsWindowsAPI(Profile* profile);
  16. virtual ~TabsWindowsAPI();
  17. // Convenience method to get the TabsWindowsAPI for a profile.
  18. static TabsWindowsAPI* Get(Profile* profile);
  19. WindowsEventRouter* windows_event_router();
  20. // ProfileKeyedService implementation.
  21. virtual void Shutdown() OVERRIDE;
  22. // ProfileKeyedAPI implementation.
  23. static ProfileKeyedAPIFactory<TabsWindowsAPI>* GetFactoryInstance();
  24. // EventRouter::Observer implementation.
  25. virtual void OnListenerAdded(const extensions::EventListenerInfo& details)
  26. OVERRIDE;
  27. private:
  28. friend class ProfileKeyedAPIFactory<TabsWindowsAPI>;
  29. Profile* profile_;
  30. // ProfileKeyedAPI implementation.
  31. static const char* service_name() {
  32. return "TabsWindowsAPI";
  33. }
  34. static const bool kServiceIsNULLWhileTesting = true;
  35. scoped_ptr<WindowsEventRouter> windows_event_router_;
  36. };
  37. } // namespace extensions
  38. #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_WINDOWS_API_H_