2013-03-13 15:12:05 -04: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 15:42:16 -04:00
|
|
|
#ifndef BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_
|
|
|
|
#define BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_
|
2013-03-13 15:12:05 -04:00
|
|
|
|
|
|
|
#include "base/compiler_specific.h"
|
|
|
|
#include "base/memory/scoped_ptr.h"
|
|
|
|
#include "content/public/browser/browser_main_parts.h"
|
|
|
|
|
2014-07-03 08:44:58 +00:00
|
|
|
#if defined(TOOLKIT_VIEWS)
|
|
|
|
namespace wm {
|
|
|
|
class WMState;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-03-13 15:12:05 -04:00
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
class BrowserContext;
|
2013-05-14 14:45:34 +08:00
|
|
|
class WebUIControllerFactory;
|
2013-03-13 15:12:05 -04:00
|
|
|
|
|
|
|
class BrowserMainParts : public content::BrowserMainParts {
|
2013-11-17 18:17:23 -05:00
|
|
|
public:
|
2013-03-13 15:12:05 -04:00
|
|
|
BrowserMainParts();
|
|
|
|
~BrowserMainParts();
|
|
|
|
|
|
|
|
BrowserContext* browser_context() { return browser_context_.get(); }
|
|
|
|
|
2013-11-17 18:17:23 -05:00
|
|
|
protected:
|
2014-07-03 09:18:24 +00:00
|
|
|
// content::BrowserMainParts:
|
2014-01-31 10:38:12 -05:00
|
|
|
virtual void PreEarlyInitialization() OVERRIDE;
|
2014-07-03 08:12:12 +00:00
|
|
|
virtual void ToolkitInitialized() OVERRIDE;
|
2013-03-13 15:12:05 -04:00
|
|
|
virtual void PreMainMessageLoopStart() OVERRIDE;
|
|
|
|
virtual void PreMainMessageLoopRun() OVERRIDE;
|
2013-10-23 12:13:24 -04:00
|
|
|
virtual void PostMainMessageLoopRun() OVERRIDE;
|
2013-12-05 02:56:28 -08:00
|
|
|
virtual int PreCreateThreads() OVERRIDE;
|
2013-03-13 15:12:05 -04:00
|
|
|
|
2014-07-03 09:18:24 +00:00
|
|
|
// Subclasses should override this to provide their own BrowserContxt
|
|
|
|
// implementation. The caller takes ownership of the returned object.
|
|
|
|
virtual BrowserContext* CreateBrowserContext();
|
|
|
|
|
|
|
|
// Override this to change how ProxyResolverV8 is initialized.
|
|
|
|
virtual void InitProxyResolverV8();
|
|
|
|
|
2013-11-17 18:17:23 -05:00
|
|
|
private:
|
2014-07-03 08:12:12 +00:00
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
void IncreaseFileDescriptorLimit();
|
|
|
|
void InitializeMainNib();
|
|
|
|
#endif
|
|
|
|
|
2013-03-13 15:12:05 -04:00
|
|
|
scoped_ptr<BrowserContext> browser_context_;
|
2013-05-14 14:45:34 +08:00
|
|
|
scoped_ptr<WebUIControllerFactory> web_ui_controller_factory_;
|
2013-03-13 15:12:05 -04:00
|
|
|
|
2014-07-03 08:44:58 +00:00
|
|
|
#if defined(TOOLKIT_VIEWS)
|
|
|
|
scoped_ptr<wm::WMState> wm_state_;
|
|
|
|
#endif
|
|
|
|
|
2013-03-13 15:12:05 -04:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(BrowserMainParts);
|
|
|
|
};
|
|
|
|
|
2013-11-17 18:17:23 -05:00
|
|
|
} // namespace brightray
|
2013-03-13 15:12:05 -04:00
|
|
|
|
2013-03-13 15:42:16 -04:00
|
|
|
#endif
|