Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6662b5e authored by John Reck's avatar John Reck
Browse files

Adds localization support for incognito start page

 Bug: 3460867
 This change has BrowserFrame intercept browser:incognito URLs to
 provide a localized version of them. It also adds a spanish
 translation for the page.

Change-Id: I888453d895ea1047544a09ba7f23645e2746bea6
parent 675a6527
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ import android.content.ComponentCallbacks;
import android.content.Context;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.graphics.Bitmap;
import android.net.ParseException;
import android.net.Uri;
@@ -933,7 +935,19 @@ class BrowserFrame extends Handler {
        if (androidResource != null) {
            return new WebResourceResponse(null, null, androidResource);
        }
        return mCallbackProxy.shouldInterceptRequest(url);
        WebResourceResponse response = mCallbackProxy.shouldInterceptRequest(url);
        if (response == null && "browser:incognito".equals(url)) {
            try {
                Resources res = mContext.getResources();
                InputStream ins = res.openRawResource(
                        com.android.internal.R.raw.incognito_mode_start_page);
                response = new WebResourceResponse("text/html", "utf8", ins);
            } catch (NotFoundException ex) {
                // This shouldn't happen, but try and gracefully handle it jic
                Log.w(LOGTAG, "Failed opening raw.incognito_mode_start_page", ex);
            }
        }
        return response;
    }

    /**
+26 −0
Original line number Diff line number Diff line
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
    <title>Nueva ventana de incógnito</title>
  </head>
  <body>
    <p><strong>Has entrado en el modo &quot;Navegar de incógnito&quot;</strong>. Las páginas
    que consultes a través de esta ventana no quedarán registradas en el historial del navegador
    ni en el historial de búsquedas, y tampoco dejarán otros rastros en el equipo (como cookies)
    una vez cerrada. Aunque sí quedarán almacenados los archivos que descargues y los marcadores
    que guardes durante la sesión.</p>

    <p><strong>La función &quot;Navegar de incógnito&quot; no afecta al comportamiento de
    otros usuarios, servidores o programas. Atención con:</strong></p>

    <ul>
      <li>sitios web que recopilan o comparten información personal,</li>
      <li>proveedores de servicios de Internet o trabajadores de estas empresas que
      supervisan las páginas que visita el usuario,</li>
      <li>software malicioso que realiza un seguimiento de las teclas que pulsa el usuario a
      cambio de unos emoticones gratuitos,</li>
      <li>el seguimiento por parte de detectives privados,</li>
      <li>personas merodeando cerca de tu equipo.</li>
    </ul>
  </body>
</html>
+24 −0
Original line number Diff line number Diff line
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
    <title>New incognito window</title>
  </head>
  <body>
    <p><strong>You've gone incognito</strong>. Pages you view in this window
      won't appear in your browser history or search history, and they won't
      leave other traces, like cookies, on your device after you close the
      incognito window. Any files you download or bookmarks you create will be
      preserved, however.</p>

    <p><strong>Going incognito doesn't affect the behavior of other people,
      servers, or software. Be wary of:</strong></p>

    <ul>
      <li>Websites that collect or share information about you</li>
      <li>Internet service providers or employers that track the pages you visit</li>
      <li>Malicious software that tracks your keystrokes in exchange for free smileys</li>
      <li>Surveillance by secret agents</li>
      <li>People standing behind you</li>
    </ul>
  </body>
</html>