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

Side by Side Diff: chrome/browser/ui/views/location_bar/suggested_text_view.h

Issue 6154001: Move animation code to new ui/base/animation directory.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SUGGESTED_TEXT_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SUGGESTED_TEXT_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SUGGESTED_TEXT_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SUGGESTED_TEXT_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "app/animation_delegate.h" 9 #include "ui/base/animation/animation_delegate.h"
10 #include "views/controls/label.h" 10 #include "views/controls/label.h"
11 11
12 class LocationBarView; 12 class LocationBarView;
13 13
14 // SuggestedTextView is used to show the suggest text in the LocationBar. 14 // SuggestedTextView is used to show the suggest text in the LocationBar.
15 // Invoke |StartAnimation| to start an animation that when done invokes 15 // Invoke |StartAnimation| to start an animation that when done invokes
16 // |OnCommitSuggestedText| on the LocationBar to commit the suggested text. 16 // |OnCommitSuggestedText| on the LocationBar to commit the suggested text.
17 class SuggestedTextView : public views::Label, 17 class SuggestedTextView : public views::Label,
18 public AnimationDelegate { 18 public ui::AnimationDelegate {
19 public: 19 public:
20 explicit SuggestedTextView(LocationBarView* location_bar); 20 explicit SuggestedTextView(LocationBarView* location_bar);
21 virtual ~SuggestedTextView(); 21 virtual ~SuggestedTextView();
22 22
23 // Starts the animation. If the animation is currently running it is stopped 23 // Starts the animation. If the animation is currently running it is stopped
24 // and restarted. The animation transitions the suggested text to look like 24 // and restarted. The animation transitions the suggested text to look like
25 // selected text. When the animation completes |OnCommitSuggestedText| is 25 // selected text. When the animation completes |OnCommitSuggestedText| is
26 // invoked on the LocationBar. 26 // invoked on the LocationBar.
27 void StartAnimation(); 27 void StartAnimation();
28 28
29 // Stops the animation. 29 // Stops the animation.
30 void StopAnimation(); 30 void StopAnimation();
31 31
32 // View overrides: 32 // View overrides:
33 virtual void PaintBackground(gfx::Canvas* canvas); 33 virtual void PaintBackground(gfx::Canvas* canvas);
34 34
35 // AnimationDelegate overrides: 35 // AnimationDelegate overrides:
36 virtual void AnimationEnded(const Animation* animation); 36 virtual void AnimationEnded(const ui::Animation* animation);
37 virtual void AnimationProgressed(const Animation* animation); 37 virtual void AnimationProgressed(const ui::Animation* animation);
38 virtual void AnimationCanceled(const Animation* animation); 38 virtual void AnimationCanceled(const ui::Animation* animation);
39 39
40 private: 40 private:
41 // Creates the animation to use. 41 // Creates the animation to use.
42 Animation* CreateAnimation(); 42 ui::Animation* CreateAnimation();
43 43
44 // Resets the background color. 44 // Resets the background color.
45 void UpdateBackgroundColor(); 45 void UpdateBackgroundColor();
46 46
47 LocationBarView* location_bar_; 47 LocationBarView* location_bar_;
48 48
49 scoped_ptr<Animation> animation_; 49 scoped_ptr<ui::Animation> animation_;
50 50
51 SkColor bg_color_; 51 SkColor bg_color_;
52 52
53 DISALLOW_COPY_AND_ASSIGN(SuggestedTextView); 53 DISALLOW_COPY_AND_ASSIGN(SuggestedTextView);
54 }; 54 };
55 55
56 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SUGGESTED_TEXT_VIEW_H_ 56 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_SUGGESTED_TEXT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698