browser_main_parts.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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(TOOLKIT_VIEWS)
  16. namespace brightray {
  17. class ViewsDelegate;
  18. }
  19. #endif
  20. #if defined(USE_AURA)
  21. namespace wm {
  22. class WMState;
  23. }
  24. #endif
  25. namespace brightray {
  26. class BrowserMainParts : public content::BrowserMainParts {
  27. public:
  28. BrowserMainParts();
  29. ~BrowserMainParts();
  30. protected:
  31. // content::BrowserMainParts:
  32. void PreEarlyInitialization() override;
  33. void ToolkitInitialized() override;
  34. void PreMainMessageLoopStart() override;
  35. void PreMainMessageLoopRun() override;
  36. void PostMainMessageLoopStart() override;
  37. void PostMainMessageLoopRun() override;
  38. int PreCreateThreads() override;
  39. void PostDestroyThreads() override;
  40. void InitializeFeatureList();
  41. private:
  42. #if defined(OS_MACOSX)
  43. void InitializeMainNib();
  44. void OverrideAppLogsPath();
  45. #endif
  46. std::unique_ptr<IOThread> io_thread_;
  47. #if defined(TOOLKIT_VIEWS)
  48. std::unique_ptr<ViewsDelegate> views_delegate_;
  49. #endif
  50. #if defined(USE_AURA)
  51. std::unique_ptr<wm::WMState> wm_state_;
  52. #endif
  53. std::unique_ptr<views::LayoutProvider> layout_provider_;
  54. std::string custom_locale_;
  55. DISALLOW_COPY_AND_ASSIGN(BrowserMainParts);
  56. };
  57. } // namespace brightray
  58. #endif // BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_