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

Side by Side Diff: chrome/browser/android/vr_shell/textures/url_bar_texture.h

Issue 2913633002: [vr] Clicking on the security icon should prompt the user to bail out of VR (Closed)
Patch Set: . 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 26 matching lines...) Expand all
37 ~UrlBarTexture() override; 37 ~UrlBarTexture() override;
38 gfx::Size GetPreferredTextureSize(int width) const override; 38 gfx::Size GetPreferredTextureSize(int width) const override;
39 gfx::SizeF GetDrawnSize() const override; 39 gfx::SizeF GetDrawnSize() const override;
40 40
41 void SetURL(const GURL& gurl); 41 void SetURL(const GURL& gurl);
42 void SetHistoryButtonsEnabled(bool can_go_back); 42 void SetHistoryButtonsEnabled(bool can_go_back);
43 void SetSecurityLevel(security_state::SecurityLevel level); 43 void SetSecurityLevel(security_state::SecurityLevel level);
44 44
45 bool HitsBackButton(const gfx::PointF& position) const; 45 bool HitsBackButton(const gfx::PointF& position) const;
46 bool HitsUrlBar(const gfx::PointF& position) const; 46 bool HitsUrlBar(const gfx::PointF& position) const;
47 bool HitsSecurityIcon(const gfx::PointF& position) const;
47 48
48 void SetHovered(bool hovered); 49 void SetHovered(bool hovered);
49 void SetPressed(bool pressed); 50 void SetPressed(bool pressed);
50 51
51 // Public for testability. 52 // Public for testability.
52 static void ApplyUrlStyling(const base::string16& formatted_url, 53 static void ApplyUrlStyling(const base::string16& formatted_url,
53 const url::Parsed& parsed, 54 const url::Parsed& parsed,
54 security_state::SecurityLevel security_level, 55 security_state::SecurityLevel security_level,
55 vr_shell::RenderTextWrapper* render_text, 56 vr_shell::RenderTextWrapper* render_text,
56 const ColorScheme& color_scheme); 57 const ColorScheme& color_scheme);
57 58
58 private: 59 private:
59 void Draw(SkCanvas* canvas, const gfx::Size& texture_size) override; 60 void Draw(SkCanvas* canvas, const gfx::Size& texture_size) override;
60 float ToPixels(float meters) const; 61 float ToPixels(float meters) const;
61 bool HitsTransparentRegion(const gfx::PointF& meters, bool left) const; 62 bool HitsTransparentRegion(const gfx::PointF& meters, bool left) const;
62 void RenderUrl(const gfx::Size& texture_size, const gfx::Rect& bounds); 63 void RenderUrl(const gfx::Size& texture_size, const gfx::Rect& bounds);
63 void OnSetMode() override; 64 void OnSetMode() override;
64 const ColorScheme& color_scheme() const; 65 const ColorScheme& color_scheme() const;
66 // Returns the location of the security icon relative to the url bar in
cjgrant 2017/06/02 04:16:36 This comment doesn't add much as it's a private me
ymalik 2017/06/02 21:14:31 Done.
67 // meters.
68 gfx::PointF security_icon_position() const;
65 69
66 gfx::SizeF size_; 70 gfx::SizeF size_;
67 bool hovered_ = false; 71 bool hovered_ = false;
68 bool pressed_ = false; 72 bool pressed_ = false;
69 bool can_go_back_ = false; 73 bool can_go_back_ = false;
70 74
71 GURL gurl_; 75 GURL gurl_;
72 security_state::SecurityLevel security_level_; 76 security_state::SecurityLevel security_level_;
73 77
74 std::unique_ptr<gfx::RenderText> url_render_text_; 78 std::unique_ptr<gfx::RenderText> url_render_text_;
75 GURL last_drawn_gurl_; 79 GURL last_drawn_gurl_;
76 security_state::SecurityLevel last_drawn_security_level_; 80 security_state::SecurityLevel last_drawn_security_level_;
77 base::Callback<void(UiUnsupportedMode)> failure_callback_; 81 base::Callback<void(UiUnsupportedMode)> failure_callback_;
78 82
79 DISALLOW_COPY_AND_ASSIGN(UrlBarTexture); 83 DISALLOW_COPY_AND_ASSIGN(UrlBarTexture);
80 }; 84 };
81 85
82 } // namespace vr_shell 86 } // namespace vr_shell
83 87
84 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_ 88 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698