From: Michał Pakuła vel Rutka Date: Thu, 26 Feb 2015 07:48:18 +0000 (+0100) Subject: ubrowser: Add support for file URI scheme X-Git-Tag: submit/tizen/20201118.160233~1149 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b42bb2181b16d2e4ee9a304c796f54da87e5bd49;p=platform%2Fframework%2Fweb%2Fchromium-efl.git ubrowser: Add support for file URI scheme Currently ubrowser converts all URLs 'http://' with exception of ones starting '/', 'http' and 'about'. This commit adds an exception for adresses starting with 'file' or 'https' so they won't be converted to 'http://' Reviewed by: Antonio Gomes, Piotr Grad, Piotr Tworek, Tomasz Weglarski Change-Id: I537a21a882abca76bbc4e0ef7bc1c369bd9d7ec9 Signed-off-by: Michał Pakuła vel Rutka --- diff --git a/tizen_src/ewk/ubrowser/window.cc b/tizen_src/ewk/ubrowser/window.cc index 2b65d9f..bc00e32 100644 --- a/tizen_src/ewk/ubrowser/window.cc +++ b/tizen_src/ewk/ubrowser/window.cc @@ -99,11 +99,15 @@ Window::~Window() { } void Window::LoadURL(std::string url) { - const static std::string http = "http"; + const static std::string http = "http://"; + const static std::string https = "https://"; + const static std::string file = "file://"; const static std::string about = "about:"; if (url.compare(0, 1, "/") == 0) { url = "file://" + url; } else if (url.compare(0, http.length(), http) != 0 && + url.compare(0, https.length(), https) != 0 && + url.compare(0, file.length(), file) != 0 && url.compare(0, about.length(), about) != 0) { url = "http://" + url; }