summaryrefslogtreecommitdiffstats
path: root/src/core/content_main_delegate_qt.cpp
diff options
context:
space:
mode:
authorXiao Zhang <xiaozhang1@blackberry.com>2013-12-10 15:16:40 +0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-10 09:26:01 +0100
commit84fc0e2476ddfc7a5eb2750f3c9b8679a01f948c (patch)
tree84388a0f1c7e67d439f5fe51b00ac6cfebaa29e3 /src/core/content_main_delegate_qt.cpp
parentae600d6b0fdb4bf9b5589df7bac162b1b112c7dd (diff)
Add ftp protocol handler.
Change-Id: Ib5ec11a23d609414f609969dbb2933d83eb6e3bd Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'src/core/content_main_delegate_qt.cpp')
-rw-r--r--src/core/content_main_delegate_qt.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index c8367fe37..8fe2f3378 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -45,15 +45,26 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/resource/resource_bundle.h"
+#include "grit/net_resources.h"
+#include "net/base/net_module.h"
#include "content_client_qt.h"
#include "web_engine_library_info.h"
+static base::StringPiece PlatformResourceProvider(int key) {
+ if (key == IDR_DIR_HEADER_HTML) {
+ base::StringPiece html_data = ui::ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_DIR_HEADER_HTML);
+ return html_data;
+ }
+ return base::StringPiece();
+}
+
void ContentMainDelegateQt::PreSandboxStartup()
{
PathService::Override(base::FILE_EXE, WebEngineLibraryInfo::subProcessPath());
PathService::Override(ui::DIR_LOCALES, WebEngineLibraryInfo::localesPath());
+ net::NetModule::SetResourceProvider(PlatformResourceProvider);
ui::ResourceBundle::InitSharedInstanceWithLocale(l10n_util::GetApplicationLocale(std::string("en-US")), 0);
}