| 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::OnMouseEnter() {} |
| 116 |
| 117 void UiElement::OnMouseLeave() {} |
| 118 |
| 119 void UiElement::OnClick() {} |
| 120 |
| 115 void UiElement::Animate(const base::TimeTicks& time) { | 121 void UiElement::Animate(const base::TimeTicks& time) { |
| 116 for (auto& it : animations) { | 122 for (auto& it : animations) { |
| 117 Animation& animation = *it; | 123 Animation& animation = *it; |
| 118 if (time < animation.start) | 124 if (time < animation.start) |
| 119 continue; | 125 continue; |
| 120 | 126 |
| 121 // If |from| is not specified, start at the current values. | 127 // If |from| is not specified, start at the current values. |
| 122 if (animation.from.size() == 0) { | 128 if (animation.from.size() == 0) { |
| 123 switch (animation.property) { | 129 switch (animation.property) { |
| 124 case Animation::SIZE: | 130 case Animation::SIZE: |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 206 |
| 201 bool UiElement::IsVisible() const { | 207 bool UiElement::IsVisible() const { |
| 202 return visible && computed_opacity > 0.0f; | 208 return visible && computed_opacity > 0.0f; |
| 203 } | 209 } |
| 204 | 210 |
| 205 bool UiElement::IsHitTestable() const { | 211 bool UiElement::IsHitTestable() const { |
| 206 return IsVisible() && hit_testable; | 212 return IsVisible() && hit_testable; |
| 207 } | 213 } |
| 208 | 214 |
| 209 } // namespace vr_shell | 215 } // namespace vr_shell |
| OLD | NEW |