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

Side by Side Diff: chrome/browser/android/vr_shell/ui_elements/close_button.h

Issue 2878083003: VR Shell: Allow UI elements to determine hit testing. (Closed)
Patch Set: Remove unrelated changes 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
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/ui_elements/close_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_UI_ELEMENTS_CLOSE_BUTTON_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h" 12 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h"
13 13
14 namespace vr_shell { 14 namespace vr_shell {
15 15
16 class CloseButtonTexture; 16 class CloseButtonTexture;
17 class UiTexture; 17 class UiTexture;
18 18
19 class CloseButton : public TexturedElement { 19 class CloseButton : public TexturedElement {
20 public: 20 public:
21 explicit CloseButton(base::Callback<void()> click_handler); 21 explicit CloseButton(base::Callback<void()> click_handler);
22 ~CloseButton() override; 22 ~CloseButton() override;
23 23
24 void OnHoverLeave() override; 24 void OnHoverLeave() override;
25 void OnHoverEnter(gfx::PointF position) override; 25 void OnHoverEnter(const gfx::PointF& position) override;
26 void OnButtonDown(gfx::PointF position) override; 26 void OnMove(const gfx::PointF& position) override;
27 void OnButtonUp(gfx::PointF position) override; 27 void OnButtonDown(const gfx::PointF& position) override;
28 void OnButtonUp(const gfx::PointF& position) override;
29 bool HitTest(const gfx::PointF& point) const override;
28 30
29 private: 31 private:
30 UiTexture* GetTexture() const override; 32 UiTexture* GetTexture() const override;
31 void OnStateUpdated(); 33 void OnStateUpdated(const gfx::PointF& position);
32 34
33 std::unique_ptr<CloseButtonTexture> texture_; 35 std::unique_ptr<CloseButtonTexture> texture_;
34 bool down_ = false; 36 bool down_ = false;
35 bool hover_ = false;
36 base::Callback<void()> click_handler_; 37 base::Callback<void()> click_handler_;
37 38
38 DISALLOW_COPY_AND_ASSIGN(CloseButton); 39 DISALLOW_COPY_AND_ASSIGN(CloseButton);
39 }; 40 };
40 41
41 } // namespace vr_shell 42 } // namespace vr_shell
42 43
43 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_ 44 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/ui_elements/close_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698