[Error Page] Lack of error page message
authorGrzegorz Spryszynski <g.spryszynsk@samsung.com>
Fri, 13 Jun 2014 22:18:34 +0000 (15:18 -0700)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Issues: CBBROWSER-135, CBBROWSER-136

[Problem] There is no message when page can not be loaded.
[Cause] The error pare is no implemented.
[Solution] Added information with description
when there is some problem with page loading.

Change-Id: I04f0b7796ec71d5b0b261a74273efac24cee0ad1

Conflicts:

src/apps/shell/app/shell_main_delegate.cc

Conflicts:

src/apps/shell/app/shell_main_delegate.cc

tizen_src/impl/eweb_view.cc
tizen_src/impl/eweb_view.h
tizen_src/impl/web_process_content_main_delegate_efl.cc

index f35481c..fcea01d 100644 (file)
@@ -31,6 +31,7 @@
 #include "API/ewk_view_private.h"
 #include "public/ewk_private.h"
 #include "web_contents_delegate_efl.h"
+#include "public/platform/WebString.h"
 
 #include "base/files/file_path.h"
 #include "base/logging.h"
@@ -50,6 +51,8 @@
 #include "third_party/WebKit/public/web/WebFindOptions.h"
 #include "ui/events/gestures/gesture_recognizer.h"
 #include "browser/motion/wkext_motion.h"
+#include "grit/webkit_strings.h"
+#include "ui/base/l10n/l10n_util.h"
 
 #ifdef OS_TIZEN
 #include <vconf.h>
@@ -1632,3 +1635,54 @@ bool EWebView::IsIMEShow() {
 gfx::Rect EWebView::GetIMERect() {
   return rwhv()->im_context()->GetIMERect();
 }
+
+std::string EWebView::GetErrorPage(const std::string& invalidUrl) {
+  base::string16 url16;
+  url16.assign(invalidUrl.begin(), invalidUrl.end());
+
+  std::string errorHead = l10n_util::GetStringUTF8(IDS_ERRORPAGES_HEADING_NOT_AVAILABLE);
+  std::string errorMessage = l10n_util::GetStringFUTF8(IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, url16);
+
+  std::string html =
+    "<html>"
+      "<head>"
+        "<meta name='viewport' content='width=device-width, initial-scale=1.0, user-scalable=no'>"
+        "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>"
+        "<title>";
+  html += invalidUrl;
+  html +=
+        "</title>"
+        "<style type=text/css>"
+        "#body"
+        "{"
+        " background-color: #fff;"
+        " margin: 0;"
+        " padding: 0;"
+        "}"
+        "#Box"
+        "{"
+        " background: #fff;"
+        " width: 80%%;"
+        " min-width: 150px;"
+        " max-width: 750px;"
+        " margin: auto;"
+        " padding: 5px;"
+        " border: 1px solid #BFA3A3;"
+        " border-radius: 1px;"
+        " word-wrap:break-word"
+        "}"
+        "</style>"
+      "</head>"
+      "<body bgcolor=\"#CFCFCF\">"
+      "<div id=Box>"
+      "<h2 align=\"center\">";
+    html += errorHead;
+    html += "</h2></br>";
+    html += errorMessage;
+    html +=
+      "</div>"
+      "</body>"
+    "</html>"
+    ;
+   return html;
+}
index 7eab524..99693ce 100644 (file)
@@ -260,6 +260,8 @@ class EWebView
   bool IsIMEShow();
   gfx::Rect GetIMERect();
 
+  std::string GetErrorPage(const std::string& invalidUrl);
+
  private:
   EWebView(EWebContext*, Evas_Object* smart_object);
   ~EWebView();
index 6f26896..db894d3 100644 (file)
@@ -38,7 +38,7 @@ ContentRendererClient* WebProcessContentMainDelegateEfl::CreateContentRendererCl
 void WebProcessContentMainDelegateEfl::PreSandboxStartup() {
   base::FilePath pak_dir;
   base::FilePath pak_file;
-  PathService::Get(base::DIR_MODULE, &pak_dir);
+  PathService::Get(base::DIR_EXE, &pak_dir);
   pak_file = pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak"));
   ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file);
 }