Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/location_bar_view.h |
| diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h |
| index 7bf3c2fe1b367839345e89bb54793a578d8736c8..01e9c152c8724c64fd14ab54e18083b8d3dc07b7 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.h |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.h |
| @@ -256,6 +256,7 @@ class LocationBarView : public LocationBar, |
| // OmniboxEditController: |
| virtual void Update(const content::WebContents* contents) OVERRIDE; |
| virtual void ShowURL() OVERRIDE; |
| + virtual void EndOriginChipAnimations() OVERRIDE; |
| virtual ToolbarModel* GetToolbarModel() OVERRIDE; |
| virtual content::WebContents* GetWebContents() OVERRIDE; |
| @@ -336,9 +337,18 @@ class LocationBarView : public LocationBar, |
| bool ShouldShowKeywordBubble() const; |
| bool ShouldShowEVBubble() const; |
| - // Origin chip animation control methods. |
| - void OnShowURLAnimationEnded(); |
| - void OnHideURLAnimationEnded(); |
| + // Used to "reverse" the URL showing/hiding animations, since we use separate |
| + // animations whose curves are not true inverses of each other. Based on the |
| + // current position of the omnibox, calculates what value the desired |
| + // animation (|hide_url_animation_| if |hide| is true, |show_url_animation_| |
| + // if it's false) should be set to in order to produce the same omnibox |
| + // position. This way we can stop the old animation, set the new animation to |
| + // this value, and start it running, and the text will appear to reverse |
| + // directions from its current location. |
| + double GetValueForAnimation(bool hide) const; |
|
Justin Donnelly
2014/05/29 21:37:29
How about GetPositionForAnimation to be more speci
Peter Kasting
2014/05/29 23:32:16
That wouldn't be correct. Because the animations
Justin Donnelly
2014/06/02 15:07:33
Ah, yeah, my bad. I made this comment before I re
|
| + |
| + // Resets |show_url_animation_| and the color changes it causes. |
| + void ResetShowAnimationAndColors(); |
| // LocationBar: |
| virtual void ShowFirstRunBubble() OVERRIDE; |
| @@ -514,9 +524,12 @@ class LocationBarView : public LocationBar, |
| // Origin chip animations. |
| scoped_ptr<gfx::SlideAnimation> show_url_animation_; |
| scoped_ptr<gfx::SlideAnimation> hide_url_animation_; |
| - |
| - // Text label shown only during origin chip animations. |
| - views::Label* animated_host_label_; |
| + int current_omnibox_offset_; |
| + int starting_omnibox_offset_; |
| + int current_omnibox_leading_inset_; |
| + int starting_omnibox_leading_inset_; |
| + int current_omnibox_width_; |
| + int ending_omnibox_width_; |
| // Used to register for notifications received by NotificationObserver. |
| content::NotificationRegistrar registrar_; |