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

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

Issue 2878543002: Refactor VR Shell Input. Locks input to click/scroll targets. (Closed)
Patch Set: 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_
7
8 #include <memory>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h"
13
14 namespace vr_shell {
15
16 class CloseButtonTexture;
17 class UiTexture;
18
19 class CloseButton : public TexturedElement {
20 public:
21 explicit CloseButton(base::Callback<void()> click_handler);
22 ~CloseButton() override;
23
24 void OnHoverLeave() override;
25 void OnHoverEnter(gfx::PointF position) override;
26 void OnButtonDown(gfx::PointF position) override;
27 void OnButtonUp(gfx::PointF position) override;
28
29 private:
30 UiTexture* GetTexture() const override;
31 void OnStateUpdated();
32
33 std::unique_ptr<CloseButtonTexture> texture_;
34 bool down_ = false;
35 bool hover_ = false;
36 base::Callback<void()> click_handler_;
37
38 DISALLOW_COPY_AND_ASSIGN(CloseButton);
39 };
40
41 } // namespace vr_shell
42
43 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698