| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" | 5 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 UiElement::~UiElement() = default; | 106 UiElement::~UiElement() = default; |
| 107 | 107 |
| 108 void UiElement::Render(VrShellRenderer* renderer, | 108 void UiElement::Render(VrShellRenderer* renderer, |
| 109 vr::Mat4f view_proj_matrix) const { | 109 vr::Mat4f view_proj_matrix) const { |
| 110 NOTREACHED(); | 110 NOTREACHED(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void UiElement::Initialize() {} | 113 void UiElement::Initialize() {} |
| 114 | 114 |
| 115 void UiElement::OnHoverEnter() {} |
| 116 |
| 117 void UiElement::OnHoverLeave() {} |
| 118 |
| 119 void UiElement::OnButtonDown() {} |
| 120 |
| 121 void UiElement::OnButtonUp() {} |
| 122 |
| 115 void UiElement::Animate(const base::TimeTicks& time) { | 123 void UiElement::Animate(const base::TimeTicks& time) { |
| 116 for (auto& it : animations) { | 124 for (auto& it : animations) { |
| 117 Animation& animation = *it; | 125 Animation& animation = *it; |
| 118 if (time < animation.start) | 126 if (time < animation.start) |
| 119 continue; | 127 continue; |
| 120 | 128 |
| 121 // If |from| is not specified, start at the current values. | 129 // If |from| is not specified, start at the current values. |
| 122 if (animation.from.size() == 0) { | 130 if (animation.from.size() == 0) { |
| 123 switch (animation.property) { | 131 switch (animation.property) { |
| 124 case Animation::SIZE: | 132 case Animation::SIZE: |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 208 |
| 201 bool UiElement::IsVisible() const { | 209 bool UiElement::IsVisible() const { |
| 202 return visible && computed_opacity > 0.0f; | 210 return visible && computed_opacity > 0.0f; |
| 203 } | 211 } |
| 204 | 212 |
| 205 bool UiElement::IsHitTestable() const { | 213 bool UiElement::IsHitTestable() const { |
| 206 return IsVisible() && hit_testable; | 214 return IsVisible() && hit_testable; |
| 207 } | 215 } |
| 208 | 216 |
| 209 } // namespace vr_shell | 217 } // namespace vr_shell |
| OLD | NEW |