electron/brightray/browser/browser_main_parts.h

77 lines
1.9 KiB
C
Raw Normal View History

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.
#ifndef BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_
#define BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_
2013-03-13 19:12:05 +00:00
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/browser_main_parts.h"
namespace devtools_http_handler {
2015-03-09 02:53:37 +00:00
class DevToolsHttpHandler;
}
#if defined(TOOLKIT_VIEWS)
2014-07-04 13:41:22 +00:00
namespace brightray {
class ViewsDelegate;
}
2014-07-09 12:05:02 +00:00
#endif
2014-07-04 13:41:22 +00:00
2014-07-09 12:05:02 +00:00
#if defined(USE_AURA) && defined(USE_X11)
namespace wm {
class WMState;
}
#endif
2013-03-13 19:12:05 +00:00
namespace brightray {
class BrowserContext;
class WebUIControllerFactory;
2013-03-13 19:12:05 +00:00
class BrowserMainParts : public content::BrowserMainParts {
public:
2013-03-13 19:12:05 +00:00
BrowserMainParts();
~BrowserMainParts();
BrowserContext* browser_context() { return browser_context_.get(); }
protected:
// content::BrowserMainParts:
2015-06-05 04:07:27 +00:00
void PreEarlyInitialization() override;
void ToolkitInitialized() override;
void PreMainMessageLoopStart() override;
void PreMainMessageLoopRun() override;
void PostMainMessageLoopRun() override;
int PreCreateThreads() override;
2013-03-13 19:12:05 +00:00
// Subclasses should override this to provide their own BrowserContxt
// implementation. The caller takes ownership of the returned object.
virtual BrowserContext* CreateBrowserContext();
private:
#if defined(OS_MACOSX)
void IncreaseFileDescriptorLimit();
void InitializeMainNib();
#endif
2013-03-13 19:12:05 +00:00
scoped_ptr<BrowserContext> browser_context_;
scoped_ptr<WebUIControllerFactory> web_ui_controller_factory_;
scoped_ptr<devtools_http_handler::DevToolsHttpHandler> devtools_http_handler_;
2013-03-13 19:12:05 +00:00
#if defined(TOOLKIT_VIEWS)
2014-07-04 13:41:22 +00:00
scoped_ptr<ViewsDelegate> views_delegate_;
2014-07-09 12:05:02 +00:00
#endif
#if defined(USE_AURA) && defined(USE_X11)
scoped_ptr<wm::WMState> wm_state_;
#endif
2013-03-13 19:12:05 +00:00
DISALLOW_COPY_AND_ASSIGN(BrowserMainParts);
};
} // namespace brightray
2013-03-13 19:12:05 +00:00
#endif