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

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

Issue 2885433003: VR: Implement Omnibox input targeting. (Closed)
Patch Set: rebase Created 3 years, 7 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
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" 12 #include "chrome/browser/android/vr_shell/textures/ui_texture.h"
13 #include "url/gurl.h" 13 #include "url/gurl.h"
14 14
15 namespace gfx { 15 namespace gfx {
16 class PointF;
16 class RenderText; 17 class RenderText;
17 } // namespace gfx 18 } // namespace gfx
18 19
19 namespace vr_shell { 20 namespace vr_shell {
20 21
21 class UrlBarTexture : public UiTexture { 22 class UrlBarTexture : public UiTexture {
22 public: 23 public:
23 enum DrawFlags { 24 enum DrawFlags {
24 FLAG_HOVER = 1 << 0, 25 FLAG_BACK_HOVER = 1 << 0,
26 FLAG_BACK_DOWN = 1 << 1,
25 }; 27 };
26 28
27 UrlBarTexture(); 29 UrlBarTexture();
28 ~UrlBarTexture() override; 30 ~UrlBarTexture() override;
29 gfx::Size GetPreferredTextureSize(int width) const override; 31 gfx::Size GetPreferredTextureSize(int width) const override;
30 gfx::SizeF GetDrawnSize() const override; 32 gfx::SizeF GetDrawnSize() const override;
31 bool SetDrawFlags(int draw_flags) override; 33 bool SetDrawFlags(int draw_flags) override;
32 34
33 void SetURL(const GURL& gurl); 35 void SetURL(const GURL& gurl);
34 void SetSecurityLevel(int level); 36 void SetSecurityLevel(int level);
35 37
38 bool HitsBackButton(const gfx::PointF& position) const;
39 bool HitsUrlBar(const gfx::PointF& position) const;
40
36 private: 41 private:
37 void Draw(SkCanvas* canvas, const gfx::Size& texture_size) override; 42 void Draw(SkCanvas* canvas, const gfx::Size& texture_size) override;
38 float ToPixels(float meters) const; 43 float ToPixels(float meters) const;
44 bool HitsTransparentRegion(const gfx::PointF& meters, bool left) const;
39 45
40 gfx::SizeF size_; 46 gfx::SizeF size_;
41 int security_level_; 47 int security_level_;
42 GURL gurl_; 48 GURL gurl_;
43 GURL last_drawn_gurl_; 49 GURL last_drawn_gurl_;
44 std::vector<std::unique_ptr<gfx::RenderText>> gurl_render_texts_; 50 std::vector<std::unique_ptr<gfx::RenderText>> gurl_render_texts_;
45 51
46 DISALLOW_COPY_AND_ASSIGN(UrlBarTexture); 52 DISALLOW_COPY_AND_ASSIGN(UrlBarTexture);
47 }; 53 };
48 54
49 } // namespace vr_shell 55 } // namespace vr_shell
50 56
51 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_ 57 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698