2013-03-13 19:12:05 +00:00
|
|
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE-CHROMIUM file.
|
|
|
|
|
2013-03-13 19:42:16 +00:00
|
|
|
#ifndef BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_
|
|
|
|
#define BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2017-05-18 23:04:05 +00:00
|
|
|
#include <memory>
|
2018-02-08 14:26:37 +00:00
|
|
|
#include <string>
|
2017-05-18 23:04:05 +00:00
|
|
|
|
2013-03-13 19:12:05 +00:00
|
|
|
#include "base/compiler_specific.h"
|
2017-05-18 21:30:32 +00:00
|
|
|
#include "base/macros.h"
|
2017-08-03 22:50:56 +00:00
|
|
|
#include "base/path_service.h"
|
|
|
|
#include "brightray/browser/brightray_paths.h"
|
2017-12-18 11:57:20 +00:00
|
|
|
#include "brightray/browser/io_thread.h"
|
2013-03-13 19:12:05 +00:00
|
|
|
#include "content/public/browser/browser_main_parts.h"
|
2017-07-03 16:23:47 +00:00
|
|
|
#include "ui/views/layout/layout_provider.h"
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2017-04-16 14:27:36 +00:00
|
|
|
#if defined(USE_AURA)
|
2014-07-03 08:44:58 +00:00
|
|
|
namespace wm {
|
|
|
|
class WMState;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-03-13 19:12:05 +00:00
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
class BrowserMainParts : public content::BrowserMainParts {
|
2013-11-17 23:17:23 +00:00
|
|
|
public:
|
2013-03-13 19:12:05 +00:00
|
|
|
BrowserMainParts();
|
2018-04-17 23:03:51 +00:00
|
|
|
~BrowserMainParts() override;
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2018-03-15 06:29:16 +00:00
|
|
|
IOThread* io_thread() const { return io_thread_.get(); }
|
|
|
|
|
2013-11-17 23:17:23 +00:00
|
|
|
protected:
|
2014-07-03 09:18:24 +00:00
|
|
|
// content::BrowserMainParts:
|
2018-07-24 08:27:32 +00:00
|
|
|
bool ShouldContentCreateFeatureList() override;
|
2018-04-05 21:09:37 +00:00
|
|
|
int PreEarlyInitialization() override;
|
2015-06-05 04:07:27 +00:00
|
|
|
void ToolkitInitialized() override;
|
|
|
|
void PreMainMessageLoopStart() override;
|
|
|
|
void PreMainMessageLoopRun() override;
|
2015-10-04 07:40:51 +00:00
|
|
|
void PostMainMessageLoopStart() override;
|
2015-06-05 04:07:27 +00:00
|
|
|
void PostMainMessageLoopRun() override;
|
|
|
|
int PreCreateThreads() override;
|
2016-05-31 07:06:51 +00:00
|
|
|
void PostDestroyThreads() override;
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2018-08-03 00:53:54 +00:00
|
|
|
void InitializeFeatureList();
|
|
|
|
|
2013-11-17 23:17:23 +00:00
|
|
|
private:
|
2014-07-03 08:12:12 +00:00
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
void InitializeMainNib();
|
2017-09-29 13:32:30 +00:00
|
|
|
void OverrideAppLogsPath();
|
2014-07-03 08:12:12 +00:00
|
|
|
#endif
|
|
|
|
|
2017-12-18 11:57:20 +00:00
|
|
|
std::unique_ptr<IOThread> io_thread_;
|
|
|
|
|
2017-04-16 14:27:36 +00:00
|
|
|
#if defined(USE_AURA)
|
2016-05-23 01:59:07 +00:00
|
|
|
std::unique_ptr<wm::WMState> wm_state_;
|
2014-07-03 08:44:58 +00:00
|
|
|
#endif
|
|
|
|
|
2017-07-03 16:23:47 +00:00
|
|
|
std::unique_ptr<views::LayoutProvider> layout_provider_;
|
2018-02-08 14:26:37 +00:00
|
|
|
std::string custom_locale_;
|
2017-07-03 16:23:47 +00:00
|
|
|
|
2013-03-13 19:12:05 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(BrowserMainParts);
|
|
|
|
};
|
|
|
|
|
2013-11-17 23:17:23 +00:00
|
|
|
} // namespace brightray
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2017-05-18 22:05:25 +00:00
|
|
|
#endif // BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_
|