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
|
|
|
|
|
|
|
#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)
|
2014-07-04 13:41:22 +00:00
|
|
|
namespace brightray {
|
|
|
|
class ViewsDelegate;
|
|
|
|
}
|
|
|
|
|
2014-07-03 08:44:58 +00:00
|
|
|
namespace wm {
|
|
|
|
class WMState;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-03-13 19:12:05 +00:00
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
class BrowserContext;
|
2013-05-14 06:45:34 +00:00
|
|
|
class WebUIControllerFactory;
|
2013-03-13 19:12:05 +00:00
|
|
|
|
|
|
|
class BrowserMainParts : public content::BrowserMainParts {
|
2013-11-17 23:17:23 +00:00
|
|
|
public:
|
2013-03-13 19:12:05 +00:00
|
|
|
BrowserMainParts();
|
|
|
|
~BrowserMainParts();
|
|
|
|
|
|
|
|
BrowserContext* browser_context() { return browser_context_.get(); }
|
|
|
|
|
2013-11-17 23:17:23 +00:00
|
|
|
protected:
|
2014-07-03 09:18:24 +00:00
|
|
|
// content::BrowserMainParts:
|
2014-01-31 15:38:12 +00:00
|
|
|
virtual void PreEarlyInitialization() OVERRIDE;
|
2014-07-03 08:12:12 +00:00
|
|
|
virtual void ToolkitInitialized() OVERRIDE;
|
2013-03-13 19:12:05 +00:00
|
|
|
virtual void PreMainMessageLoopStart() OVERRIDE;
|
|
|
|
virtual void PreMainMessageLoopRun() OVERRIDE;
|
2013-10-23 16:13:24 +00:00
|
|
|
virtual void PostMainMessageLoopRun() OVERRIDE;
|
2013-12-05 10:56:28 +00:00
|
|
|
virtual int PreCreateThreads() OVERRIDE;
|
2013-03-13 19:12:05 +00: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 23:17:23 +00:00
|
|
|
private:
|
2014-07-03 08:12:12 +00:00
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
void IncreaseFileDescriptorLimit();
|
|
|
|
void InitializeMainNib();
|
|
|
|
#endif
|
|
|
|
|
2013-03-13 19:12:05 +00:00
|
|
|
scoped_ptr<BrowserContext> browser_context_;
|
2013-05-14 06:45:34 +00:00
|
|
|
scoped_ptr<WebUIControllerFactory> web_ui_controller_factory_;
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2014-07-03 08:44:58 +00:00
|
|
|
#if defined(TOOLKIT_VIEWS)
|
2014-07-04 13:41:22 +00:00
|
|
|
scoped_ptr<ViewsDelegate> views_delegate_;
|
2014-07-03 08:44:58 +00:00
|
|
|
scoped_ptr<wm::WMState> wm_state_;
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
|
2013-03-13 19:42:16 +00:00
|
|
|
#endif
|