Merge pull request #40 from brightray/default-browser-client

Create a BrowserClient by default
This commit is contained in:
Adam Roben 2013-12-03 14:14:18 -08:00
commit 873f52ffe2
2 changed files with 17 additions and 0 deletions

View file

@ -58,4 +58,13 @@ void MainDelegate::InitializeResourceBundle() {
} }
} }
content::ContentBrowserClient* MainDelegate::CreateContentBrowserClient() {
browser_client_ = CreateBrowserClient().Pass();
return browser_client_.get();
}
scoped_ptr<BrowserClient> MainDelegate::CreateBrowserClient() {
return make_scoped_ptr(new BrowserClient).Pass();
}
} // namespace brightray } // namespace brightray

View file

@ -17,6 +17,7 @@ class FilePath;
namespace brightray { namespace brightray {
class BrowserClient;
class ContentClient; class ContentClient;
class MainDelegate : public content::ContentMainDelegate { class MainDelegate : public content::ContentMainDelegate {
@ -29,6 +30,10 @@ class MainDelegate : public content::ContentMainDelegate {
// implementation. // implementation.
virtual scoped_ptr<ContentClient> CreateContentClient(); virtual scoped_ptr<ContentClient> CreateContentClient();
// Subclasses can override this to provide their own BrowserClient
// implementation.
virtual scoped_ptr<BrowserClient> CreateBrowserClient();
// Subclasses can override this to provide additional .pak files to be // Subclasses can override this to provide additional .pak files to be
// included in the ui::ResourceBundle. // included in the ui::ResourceBundle.
virtual void AddPakPaths(std::vector<base::FilePath>* pak_paths) {} virtual void AddPakPaths(std::vector<base::FilePath>* pak_paths) {}
@ -37,6 +42,8 @@ class MainDelegate : public content::ContentMainDelegate {
virtual void PreSandboxStartup() OVERRIDE; virtual void PreSandboxStartup() OVERRIDE;
private: private:
virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE;
void InitializeResourceBundle(); void InitializeResourceBundle();
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
static base::FilePath GetResourcesPakFilePath(); static base::FilePath GetResourcesPakFilePath();
@ -45,6 +52,7 @@ class MainDelegate : public content::ContentMainDelegate {
#endif #endif
scoped_ptr<ContentClient> content_client_; scoped_ptr<ContentClient> content_client_;
scoped_ptr<BrowserClient> browser_client_;
DISALLOW_COPY_AND_ASSIGN(MainDelegate); DISALLOW_COPY_AND_ASSIGN(MainDelegate);
}; };