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

Side by Side Diff: chrome/browser/android/vr_shell/ui_elements/loading_indicator.cc

Issue 2966793002: NOT FOR REVIEW - convert to cc animation
Patch Set: switch to transform operations Created 3 years, 5 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 #include "chrome/browser/android/vr_shell/ui_elements/loading_indicator.h" 5 #include "chrome/browser/android/vr_shell/ui_elements/loading_indicator.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/android/vr_shell/textures/loading_indicator_texture.h" 8 #include "chrome/browser/android/vr_shell/textures/loading_indicator_texture.h"
9 9
10 namespace vr_shell { 10 namespace vr_shell {
11 11
12 namespace { 12 namespace {
13 13
14 static constexpr int kVisibilityTimeoutMs = 200; 14 static constexpr int kVisibilityTimeoutMs = 200;
15 } 15 }
16 16
17 LoadingIndicator::LoadingIndicator(int preferred_width) 17 LoadingIndicator::LoadingIndicator(int id, int preferred_width)
18 : TexturedElement(preferred_width), 18 : TexturedElement(id, preferred_width),
19 texture_(base::MakeUnique<LoadingIndicatorTexture>()) { 19 texture_(base::MakeUnique<LoadingIndicatorTexture>()) {
20 set_visible(false); 20 set_visible(false);
21 } 21 }
22 22
23 LoadingIndicator::~LoadingIndicator() = default; 23 LoadingIndicator::~LoadingIndicator() = default;
24 24
25 UiTexture* LoadingIndicator::GetTexture() const { 25 UiTexture* LoadingIndicator::GetTexture() const {
26 return texture_.get(); 26 return texture_.get();
27 } 27 }
28 28
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void LoadingIndicator::SetVisibility() { 60 void LoadingIndicator::SetVisibility() {
61 set_visible(enabled_ && (loading_ || visibility_timer_.IsRunning())); 61 set_visible(enabled_ && (loading_ || visibility_timer_.IsRunning()));
62 } 62 }
63 63
64 void LoadingIndicator::OnBeginFrame(const base::TimeTicks& ticks) { 64 void LoadingIndicator::OnBeginFrame(const base::TimeTicks& ticks) {
65 if (enabled_) 65 if (enabled_)
66 UpdateTexture(); 66 UpdateTexture();
67 } 67 }
68 68
69 } // namespace vr_shell 69 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698