OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #import "chrome/browser/ui/cocoa/autofill/autofill_loading_shield_controller.h" | 5 #import "chrome/browser/ui/cocoa/autofill/autofill_loading_shield_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" | 10 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 } // namespace | 26 } // namespace |
27 | 27 |
28 | 28 |
29 // A C++ bridge class for driving the animation. | 29 // A C++ bridge class for driving the animation. |
30 class AutofillLoadingAnimationBridge : public gfx::AnimationDelegate { | 30 class AutofillLoadingAnimationBridge : public gfx::AnimationDelegate { |
31 public: | 31 public: |
32 AutofillLoadingAnimationBridge(AutofillLoadingShieldController* controller, | 32 AutofillLoadingAnimationBridge(AutofillLoadingShieldController* controller, |
33 int font_size) | 33 int font_size) |
34 : animation_(this, font_size), | 34 : animation_(this, font_size), |
35 controller_(controller) {} | 35 controller_(controller) {} |
36 virtual ~AutofillLoadingAnimationBridge() {} | 36 ~AutofillLoadingAnimationBridge() override {} |
37 | 37 |
38 // gfx::AnimationDelegate implementation. | 38 // gfx::AnimationDelegate implementation. |
39 virtual void AnimationProgressed(const gfx::Animation* animation) override { | 39 void AnimationProgressed(const gfx::Animation* animation) override { |
40 DCHECK_EQ(animation, &animation_); | 40 DCHECK_EQ(animation, &animation_); |
41 [controller_ relayoutDotsForSteppedAnimation:animation_]; | 41 [controller_ relayoutDotsForSteppedAnimation:animation_]; |
42 } | 42 } |
43 | 43 |
44 autofill::LoadingAnimation* animation() { return &animation_; } | 44 autofill::LoadingAnimation* animation() { return &animation_; } |
45 | 45 |
46 private: | 46 private: |
47 autofill::LoadingAnimation animation_; | 47 autofill::LoadingAnimation animation_; |
48 AutofillLoadingShieldController* const controller_; // weak, owns |this| | 48 AutofillLoadingShieldController* const controller_; // weak, owns |this| |
49 }; | 49 }; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 (const autofill::LoadingAnimation&)animation { | 160 (const autofill::LoadingAnimation&)animation { |
161 for (NSView* dot in dots_.get()) { | 161 for (NSView* dot in dots_.get()) { |
162 NSPoint origin = [dot frame].origin; | 162 NSPoint origin = [dot frame].origin; |
163 origin.y = [message_ frame].origin.y - | 163 origin.y = [message_ frame].origin.y - |
164 animation.GetCurrentValueForDot([dot tag]); | 164 animation.GetCurrentValueForDot([dot tag]); |
165 [dot setFrameOrigin:origin]; | 165 [dot setFrameOrigin:origin]; |
166 } | 166 } |
167 } | 167 } |
168 | 168 |
169 @end | 169 @end |
OLD | NEW |