browser_process.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. // This interface is for managing the global services of the application. Each
  5. // service is lazily created when requested the first time. The service getters
  6. // will return NULL if the service is not available, so callers must check for
  7. // this condition.
  8. #ifndef CHROME_BROWSER_BROWSER_PROCESS_H_
  9. #define CHROME_BROWSER_BROWSER_PROCESS_H_
  10. #include <memory>
  11. #include <string>
  12. #include "base/macros.h"
  13. class IconManager;
  14. namespace printing {
  15. class PrintJobManager;
  16. }
  17. // NOT THREAD SAFE, call only from the main thread.
  18. // These functions shouldn't return NULL unless otherwise noted.
  19. class BrowserProcess {
  20. public:
  21. BrowserProcess();
  22. ~BrowserProcess();
  23. void SetApplicationLocale(const std::string& locale);
  24. std::string GetApplicationLocale();
  25. IconManager* GetIconManager();
  26. printing::PrintJobManager* print_job_manager();
  27. private:
  28. std::unique_ptr<printing::PrintJobManager> print_job_manager_;
  29. std::unique_ptr<IconManager> icon_manager_;
  30. std::string locale_;
  31. DISALLOW_COPY_AND_ASSIGN(BrowserProcess);
  32. };
  33. extern BrowserProcess* g_browser_process;
  34. #endif // CHROME_BROWSER_BROWSER_PROCESS_H_