// Custom schemes to be registered to handle service worker.
std::string g_custom_service_worker_schemes = "";
-const std::string kDefaultEncoding = "UTF-8";
-
void Noop(scoped_refptr<content::SiteInstance>) {
}
prefs->allow_file_access_from_file_urls = true;
prefs->experimental_webgl_enabled = true;
prefs->allow_running_insecure_content = false;
- prefs->default_encoding = kDefaultEncoding;
+ // TODO: Encoding type should be set based on the app control received
+ prefs->default_encoding = atom::Browser::Get()->GetEncodingType();
prefs->uses_encoding_detector = false;
// Custom preferences of guest page.
#include "common/string_utils.h"
#include "tizen/browser/tizen_browser_parts.h"
#include "tizen/browser/vibration_manager.h"
+#include "tizen_src/ewk/efl_integration/text_encoding_map_efl.h"
#if defined(TIZEN_VIDEO_HOLE)
#include "atom/browser/native_window_efl.h"
namespace {
+const std::string kDefaultEncoding = "UTF-8";
+
const char* kDefaultCSPRule =
"default-src *; script-src 'self'; style-src 'self'; object-src 'none';";
}
}
+std::string TizenBrowserParts::GetEncodingType() {
+ std::unique_ptr<common::ResourceManager::Resource> res =
+ resource_manager_->GetDefaultResource();
+ if (TextEncodingMapEfl::GetInstance()->isTextEncodingValid(res->encoding().c_str()))
+ return res->encoding();
+ else return kDefaultEncoding;
+}
+
} // namespace tizen
void Suspend(content::RenderViewHost* rvh);
void Resume(content::RenderViewHost* rvh);
void GetCSP(std::string& csp_rule, std::string& csp_report_rule);
+ std::string GetEncodingType();
bool ShouldAllowNavigation(const std::string &url);
void Initialize();
std::string DecryptResource(const std::string& path);
void set_base_resource_path(const std::string& base_path);
+ // TODO: Make it a private member again
+ std::unique_ptr<Resource> GetDefaultResource();
private:
std::unique_ptr<Resource> GetMatchedResource(
const wgt::parse::AppControlInfo&);
- std::unique_ptr<Resource> GetDefaultResource();
// for localization
bool Exists(const std::string& path);