2014-10-31 18:17:05 +00:00
|
|
|
// Copyright (c) 2013 GitHub, Inc.
|
2014-04-25 09:49:37 +00:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
2013-04-12 01:46:58 +00:00
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2014-03-16 00:58:59 +00:00
|
|
|
#ifndef ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_
|
|
|
|
#define ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2014-10-17 04:41:40 +00:00
|
|
|
#include "base/timer/timer.h"
|
2013-04-12 01:46:58 +00:00
|
|
|
#include "brightray/browser/browser_main_parts.h"
|
|
|
|
|
2015-06-18 08:33:12 +00:00
|
|
|
class BrowserProcess;
|
|
|
|
|
2013-04-12 01:46:58 +00:00
|
|
|
namespace atom {
|
|
|
|
|
2014-04-25 08:13:16 +00:00
|
|
|
class AtomBindings;
|
2013-05-02 15:43:23 +00:00
|
|
|
class Browser;
|
2014-07-28 08:00:15 +00:00
|
|
|
class JavascriptEnvironment;
|
2013-04-13 10:39:09 +00:00
|
|
|
class NodeBindings;
|
|
|
|
|
2013-04-12 01:46:58 +00:00
|
|
|
class AtomBrowserMainParts : public brightray::BrowserMainParts {
|
2013-04-12 15:16:16 +00:00
|
|
|
public:
|
2013-04-12 01:46:58 +00:00
|
|
|
AtomBrowserMainParts();
|
2013-04-12 15:16:16 +00:00
|
|
|
virtual ~AtomBrowserMainParts();
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2013-04-22 13:32:48 +00:00
|
|
|
static AtomBrowserMainParts* Get();
|
|
|
|
|
2013-05-02 15:43:23 +00:00
|
|
|
Browser* browser() { return browser_.get(); }
|
2013-04-22 13:32:48 +00:00
|
|
|
|
2013-04-12 15:16:16 +00:00
|
|
|
protected:
|
2013-04-15 16:25:08 +00:00
|
|
|
// Implementations of brightray::BrowserMainParts.
|
2015-01-10 01:24:36 +00:00
|
|
|
brightray::BrowserContext* CreateBrowserContext() override;
|
2013-04-15 16:25:08 +00:00
|
|
|
|
|
|
|
// Implementations of content::BrowserMainParts.
|
2015-01-10 01:24:36 +00:00
|
|
|
void PostEarlyInitialization() override;
|
|
|
|
void PreMainMessageLoopRun() override;
|
2013-07-04 12:09:11 +00:00
|
|
|
#if defined(OS_MACOSX)
|
2015-01-10 01:24:36 +00:00
|
|
|
void PreMainMessageLoopStart() override;
|
|
|
|
void PostDestroyThreads() override;
|
2013-07-04 12:09:11 +00:00
|
|
|
#endif
|
2013-04-12 01:46:58 +00:00
|
|
|
|
2013-04-13 10:39:09 +00:00
|
|
|
private:
|
2014-10-21 10:50:50 +00:00
|
|
|
#if defined(USE_X11)
|
|
|
|
void SetDPIFromGSettings();
|
|
|
|
#endif
|
|
|
|
|
2015-06-18 08:33:12 +00:00
|
|
|
// A fake BrowserProcess object that used to feed the source code from chrome.
|
|
|
|
scoped_ptr<BrowserProcess> fake_browser_process_;
|
|
|
|
|
2013-05-02 15:43:23 +00:00
|
|
|
scoped_ptr<Browser> browser_;
|
2014-07-28 08:00:15 +00:00
|
|
|
scoped_ptr<JavascriptEnvironment> js_env_;
|
2013-04-13 10:39:09 +00:00
|
|
|
scoped_ptr<NodeBindings> node_bindings_;
|
2014-07-28 08:00:15 +00:00
|
|
|
scoped_ptr<AtomBindings> atom_bindings_;
|
2014-06-30 06:16:16 +00:00
|
|
|
|
2014-10-17 04:41:40 +00:00
|
|
|
base::Timer gc_timer_;
|
|
|
|
|
2013-04-22 13:32:48 +00:00
|
|
|
static AtomBrowserMainParts* self_;
|
|
|
|
|
2013-04-12 01:46:58 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(AtomBrowserMainParts);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
2014-03-16 00:58:59 +00:00
|
|
|
#endif // ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_
|