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_COMMON_MAIN_DELEGATE_H_
|
|
|
|
#define BRIGHTRAY_COMMON_MAIN_DELEGATE_H_
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2013-11-17 23:57:54 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2013-03-13 19:12:05 +00:00
|
|
|
#include "base/compiler_specific.h"
|
|
|
|
#include "base/memory/scoped_ptr.h"
|
|
|
|
#include "content/public/app/content_main_delegate.h"
|
2013-04-26 15:04:51 +00:00
|
|
|
|
|
|
|
namespace base {
|
|
|
|
class FilePath;
|
|
|
|
}
|
2013-03-13 19:12:05 +00:00
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
2013-12-03 22:12:21 +00:00
|
|
|
class BrowserClient;
|
2013-03-14 13:03:50 +00:00
|
|
|
class ContentClient;
|
|
|
|
|
2013-03-13 19:12:05 +00:00
|
|
|
class MainDelegate : public content::ContentMainDelegate {
|
2013-11-17 23:57:54 +00:00
|
|
|
public:
|
2013-03-13 19:12:05 +00:00
|
|
|
MainDelegate();
|
|
|
|
~MainDelegate();
|
|
|
|
|
2013-11-17 23:57:54 +00:00
|
|
|
protected:
|
|
|
|
// Subclasses can override this to provide their own ContentClient
|
|
|
|
// implementation.
|
2013-04-24 22:30:47 +00:00
|
|
|
virtual scoped_ptr<ContentClient> CreateContentClient();
|
|
|
|
|
2013-12-03 22:12:21 +00:00
|
|
|
// Subclasses can override this to provide their own BrowserClient
|
|
|
|
// implementation.
|
|
|
|
virtual scoped_ptr<BrowserClient> CreateBrowserClient();
|
|
|
|
|
2013-11-17 23:57:54 +00:00
|
|
|
// Subclasses can override this to provide additional .pak files to be
|
|
|
|
// included in the ui::ResourceBundle.
|
2013-04-26 15:04:51 +00:00
|
|
|
virtual void AddPakPaths(std::vector<base::FilePath>* pak_paths) {}
|
|
|
|
|
2014-07-09 09:07:00 +00:00
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
// Subclasses can override this to custom the paths of child process and
|
|
|
|
// framework bundle.
|
|
|
|
virtual base::FilePath GetResourcesPakFilePath();
|
|
|
|
virtual void OverrideChildProcessPath();
|
|
|
|
virtual void OverrideFrameworkBundlePath();
|
|
|
|
#endif
|
|
|
|
|
2013-03-28 16:34:49 +00:00
|
|
|
virtual bool BasicStartupComplete(int* exit_code) OVERRIDE;
|
|
|
|
virtual void PreSandboxStartup() OVERRIDE;
|
|
|
|
|
2013-11-17 23:57:54 +00:00
|
|
|
private:
|
2013-12-03 22:12:21 +00:00
|
|
|
virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE;
|
|
|
|
|
2013-05-21 15:39:25 +00:00
|
|
|
void InitializeResourceBundle();
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2013-03-14 13:03:50 +00:00
|
|
|
scoped_ptr<ContentClient> content_client_;
|
2013-12-03 22:12:21 +00:00
|
|
|
scoped_ptr<BrowserClient> browser_client_;
|
2013-03-14 13:03:50 +00:00
|
|
|
|
2013-03-13 19:12:05 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(MainDelegate);
|
|
|
|
};
|
|
|
|
|
2013-11-17 23:20:17 +00:00
|
|
|
} // namespace brightray
|
2013-03-13 19:42:16 +00:00
|
|
|
#endif
|