diff --git a/brightray/common/main_delegate.cc b/brightray/common/main_delegate.cc index a5ecc5f45986..f85c769bafc4 100644 --- a/brightray/common/main_delegate.cc +++ b/brightray/common/main_delegate.cc @@ -58,4 +58,13 @@ void MainDelegate::InitializeResourceBundle() { } } +content::ContentBrowserClient* MainDelegate::CreateContentBrowserClient() { + browser_client_ = CreateBrowserClient().Pass(); + return browser_client_.get(); +} + +scoped_ptr MainDelegate::CreateBrowserClient() { + return make_scoped_ptr(new BrowserClient).Pass(); +} + } // namespace brightray diff --git a/brightray/common/main_delegate.h b/brightray/common/main_delegate.h index 5850f9593b28..0c5107327f7e 100644 --- a/brightray/common/main_delegate.h +++ b/brightray/common/main_delegate.h @@ -17,6 +17,7 @@ class FilePath; namespace brightray { +class BrowserClient; class ContentClient; class MainDelegate : public content::ContentMainDelegate { @@ -29,6 +30,10 @@ class MainDelegate : public content::ContentMainDelegate { // implementation. virtual scoped_ptr CreateContentClient(); + // Subclasses can override this to provide their own BrowserClient + // implementation. + virtual scoped_ptr CreateBrowserClient(); + // Subclasses can override this to provide additional .pak files to be // included in the ui::ResourceBundle. virtual void AddPakPaths(std::vector* pak_paths) {} @@ -37,6 +42,8 @@ class MainDelegate : public content::ContentMainDelegate { virtual void PreSandboxStartup() OVERRIDE; private: + virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; + void InitializeResourceBundle(); #if defined(OS_MACOSX) static base::FilePath GetResourcesPakFilePath(); @@ -45,6 +52,7 @@ class MainDelegate : public content::ContentMainDelegate { #endif scoped_ptr content_client_; + scoped_ptr browser_client_; DISALLOW_COPY_AND_ASSIGN(MainDelegate); };