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_COMMON_MAIN_DELEGATE_H_
|
|
|
|
#define BRIGHTRAY_COMMON_MAIN_DELEGATE_H_
|
2013-03-13 15:12:05 -04:00
|
|
|
|
2016-05-23 15:08:20 +09:00
|
|
|
#include <memory>
|
2017-05-18 15:06:57 -07:00
|
|
|
#include <string>
|
2016-05-23 15:08:20 +09:00
|
|
|
|
2016-05-23 10:59:07 +09:00
|
|
|
#include "base/macros.h"
|
2013-03-13 15:12:05 -04:00
|
|
|
#include "content/public/app/content_main_delegate.h"
|
2013-04-26 11:04:51 -04:00
|
|
|
|
|
|
|
namespace base {
|
|
|
|
class FilePath;
|
|
|
|
}
|
2013-03-13 15:12:05 -04:00
|
|
|
|
2014-07-12 21:16:13 +08:00
|
|
|
namespace ui {
|
|
|
|
class ResourceBundle;
|
|
|
|
}
|
|
|
|
|
2013-03-13 15:12:05 -04:00
|
|
|
namespace brightray {
|
|
|
|
|
2013-12-03 17:12:21 -05:00
|
|
|
class BrowserClient;
|
2013-03-14 09:03:50 -04:00
|
|
|
class ContentClient;
|
|
|
|
|
2016-01-08 12:04:23 +08:00
|
|
|
void InitializeResourceBundle(const std::string& locale);
|
2017-01-17 20:25:28 +05:30
|
|
|
void LoadCommonResources();
|
2016-01-08 12:04:23 +08:00
|
|
|
|
2013-03-13 15:12:05 -04:00
|
|
|
class MainDelegate : public content::ContentMainDelegate {
|
2013-11-17 18:57:54 -05:00
|
|
|
public:
|
2013-03-13 15:12:05 -04:00
|
|
|
MainDelegate();
|
|
|
|
~MainDelegate();
|
|
|
|
|
2013-11-17 18:57:54 -05:00
|
|
|
protected:
|
|
|
|
// Subclasses can override this to provide their own ContentClient
|
|
|
|
// implementation.
|
2016-05-23 10:59:07 +09:00
|
|
|
virtual std::unique_ptr<ContentClient> CreateContentClient();
|
2013-04-24 18:30:47 -04:00
|
|
|
|
2013-12-03 17:12:21 -05:00
|
|
|
// Subclasses can override this to provide their own BrowserClient
|
|
|
|
// implementation.
|
2016-05-23 10:59:07 +09:00
|
|
|
virtual std::unique_ptr<BrowserClient> CreateBrowserClient();
|
2013-12-03 17:12:21 -05:00
|
|
|
|
2014-07-09 17:07:00 +08:00
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
// Subclasses can override this to custom the paths of child process and
|
|
|
|
// framework bundle.
|
|
|
|
virtual void OverrideChildProcessPath();
|
|
|
|
virtual void OverrideFrameworkBundlePath();
|
|
|
|
#endif
|
|
|
|
|
2015-06-05 12:07:27 +08:00
|
|
|
bool BasicStartupComplete(int* exit_code) override;
|
|
|
|
void PreSandboxStartup() override;
|
2013-03-28 12:34:49 -04:00
|
|
|
|
2013-11-17 18:57:54 -05:00
|
|
|
private:
|
2015-06-05 12:07:27 +08:00
|
|
|
content::ContentBrowserClient* CreateContentBrowserClient() override;
|
2013-12-03 17:12:21 -05:00
|
|
|
|
2016-05-23 10:59:07 +09:00
|
|
|
std::unique_ptr<ContentClient> content_client_;
|
|
|
|
std::unique_ptr<BrowserClient> browser_client_;
|
2013-03-14 09:03:50 -04:00
|
|
|
|
2013-03-13 15:12:05 -04:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(MainDelegate);
|
|
|
|
};
|
|
|
|
|
2013-11-17 18:20:17 -05:00
|
|
|
} // namespace brightray
|
2017-05-18 15:05:25 -07:00
|
|
|
|
|
|
|
#endif // BRIGHTRAY_COMMON_MAIN_DELEGATE_H_
|