Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(829)

Unified Diff: chrome/browser/android/vr_shell/textures/url_bar_texture.h

Issue 2945173006: VR: Enforce LTR directionality on rendered URL text. (Closed)
Patch Set: Add a test to ensure that a malicious RTL URL cannot spoof a hostname. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/textures/url_bar_texture.h
diff --git a/chrome/browser/android/vr_shell/textures/url_bar_texture.h b/chrome/browser/android/vr_shell/textures/url_bar_texture.h
index c848cf19bc81a37956f3c97f1d1385a228582e3c..11e18d0d57c80d7dc75aa72f5d0b0fff221555b3 100644
--- a/chrome/browser/android/vr_shell/textures/url_bar_texture.h
+++ b/chrome/browser/android/vr_shell/textures/url_bar_texture.h
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/macros.h"
+#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/android/vr_shell/textures/ui_texture.h"
#include "chrome/browser/android/vr_shell/ui_unsupported_mode.h"
#include "components/security_state/core/security_state.h"
@@ -51,13 +52,16 @@ class UrlBarTexture : public UiTexture {
void SetBackButtonHovered(bool hovered);
void SetBackButtonPressed(bool pressed);
- // Public for testability.
+ protected:
static void ApplyUrlStyling(const base::string16& formatted_url,
const url::Parsed& parsed,
security_state::SecurityLevel security_level,
vr_shell::RenderTextWrapper* render_text,
const ColorScheme& color_scheme);
+ std::unique_ptr<gfx::RenderText> url_render_text_;
+ base::string16 url_text_;
+
private:
void Draw(SkCanvas* canvas, const gfx::Size& texture_size) override;
float ToPixels(float meters) const;
@@ -77,7 +81,6 @@ class UrlBarTexture : public UiTexture {
security_state::SecurityLevel::NONE;
bool malware_ = false;
- std::unique_ptr<gfx::RenderText> url_render_text_;
GURL last_drawn_gurl_;
bool has_back_button_ = true;
bool has_security_chip_ = true;

Powered by Google App Engine
This is Rietveld 408576698