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

Unified Diff: chrome/browser/ui/autofill/loading_animation.cc

Issue 1931043002: Remove requestAutocomplete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/autofill/loading_animation.h ('k') | chrome/browser/ui/autofill/mock_address_validator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/loading_animation.cc
diff --git a/chrome/browser/ui/autofill/loading_animation.cc b/chrome/browser/ui/autofill/loading_animation.cc
deleted file mode 100644
index 3e0aeb0c3f3dfaa25d8ae3ada9602683d5898dc9..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/autofill/loading_animation.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/autofill/loading_animation.h"
-
-#include "base/logging.h"
-#include "base/macros.h"
-#include "ui/gfx/animation/tween.h"
-
-namespace autofill {
-
-// Duration of one cycle of the animation.
-static const int kDurationMs = 1800;
-
-// The frame rate of the animation.
-static const int kHertz = 60;
-
-LoadingAnimation::LoadingAnimation(gfx::AnimationDelegate* delegate,
- int font_height)
- : LinearAnimation(kDurationMs, kHertz, delegate),
- first_cycle_(true),
- font_height_(font_height) {}
-
-LoadingAnimation::~LoadingAnimation() {}
-
-void LoadingAnimation::Step(base::TimeTicks time_now) {
- LinearAnimation::Step(time_now);
-
- if (!is_animating()) {
- first_cycle_ = false;
- Start();
- }
-}
-
-double LoadingAnimation::GetCurrentValueForDot(size_t dot_i) const {
- double base_value = gfx::LinearAnimation::GetCurrentValue();
-
- const double kSecondDotDelayMs = 100.0;
- const double kThirdDotDelayMs = 300.0;
- if (dot_i == 1)
- base_value -= kSecondDotDelayMs / kDurationMs;
- else if (dot_i == 2)
- base_value -= kThirdDotDelayMs / kDurationMs;
-
- if (base_value < 0.0)
- base_value = first_cycle_ ? 0.0 : base_value + 1.0;
-
- double value = gfx::Tween::CalculateValue(gfx::Tween::EASE_OUT, base_value);
-
- static AnimationFrame kAnimationFrames[] = {
- { 0.0, 0.0 },
- { 0.55, 0.0 },
- { 0.6, -1.0 },
- { 0.8, 0.3 },
- { 0.9, -0.2 },
- { 0.95, 0.1 },
- { 1.0, 0.0 },
- };
-
- for (size_t i = 0; i < arraysize(kAnimationFrames); ++i) {
- if (value > kAnimationFrames[i].value)
- continue;
-
- double position;
- if (i == 0) {
- position = kAnimationFrames[i].position;
- } else {
- double inter_frame_value =
- (value - kAnimationFrames[i - 1].value) /
- (kAnimationFrames[i].value - kAnimationFrames[i - 1].value);
- position = gfx::Tween::FloatValueBetween(inter_frame_value,
- kAnimationFrames[i - 1].position,
- kAnimationFrames[i].position);
- }
- return position * font_height_ / 2.0;
- }
-
- NOTREACHED();
- return 0.0;
-}
-
-void LoadingAnimation::Reset() {
- Stop();
- first_cycle_ = true;
-}
-
-} // namespace autofill
« no previous file with comments | « chrome/browser/ui/autofill/loading_animation.h ('k') | chrome/browser/ui/autofill/mock_address_validator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698