browser_main_parts.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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-CHROMIUM file.
  4. #ifndef BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_
  5. #define BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_
  6. #include <memory>
  7. #include <string>
  8. #include "base/compiler_specific.h"
  9. #include "base/macros.h"
  10. #include "base/path_service.h"
  11. #include "brightray/browser/brightray_paths.h"
  12. #include "brightray/browser/io_thread.h"
  13. #include "content/public/browser/browser_main_parts.h"
  14. #include "ui/views/layout/layout_provider.h"
  15. #if defined(USE_AURA)
  16. namespace wm {
  17. class WMState;
  18. }
  19. #endif
  20. namespace brightray {
  21. class BrowserMainParts : public content::BrowserMainParts {
  22. public:
  23. BrowserMainParts();
  24. ~BrowserMainParts() override;
  25. IOThread* io_thread() const { return io_thread_.get(); }
  26. protected:
  27. // content::BrowserMainParts:
  28. void PreEarlyInitialization() override;
  29. void ToolkitInitialized() override;
  30. void PreMainMessageLoopStart() override;
  31. void PreMainMessageLoopRun() override;
  32. void PostMainMessageLoopStart() override;
  33. void PostMainMessageLoopRun() override;
  34. int PreCreateThreads() override;
  35. void PostDestroyThreads() override;
  36. private:
  37. #if defined(OS_MACOSX)
  38. void InitializeMainNib();
  39. void OverrideAppLogsPath();
  40. #endif
  41. std::unique_ptr<IOThread> io_thread_;
  42. #if defined(USE_AURA)
  43. std::unique_ptr<wm::WMState> wm_state_;
  44. #endif
  45. std::unique_ptr<views::LayoutProvider> layout_provider_;
  46. std::string custom_locale_;
  47. DISALLOW_COPY_AND_ASSIGN(BrowserMainParts);
  48. };
  49. } // namespace brightray
  50. #endif // BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_