Commit 0a2d8a11 authored by sangwoo.ko's avatar sangwoo.ko Committed by Commit Bot

Apply AnimationDelegateViews to DropdownBarHost

This allows DropdownBarHost animation to be driven by ui::Compositor.
There's no intentional behavior change.

Bug: 953585
Change-Id: Ie2d4ce5666dd8f1d07918083fcbb813e06c1c3c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1750504
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686487}
parent c6b2db21
...@@ -23,7 +23,8 @@ bool DropdownBarHost::disable_animations_during_testing_ = false; ...@@ -23,7 +23,8 @@ bool DropdownBarHost::disable_animations_during_testing_ = false;
// DropdownBarHost, public: // DropdownBarHost, public:
DropdownBarHost::DropdownBarHost(BrowserView* browser_view) DropdownBarHost::DropdownBarHost(BrowserView* browser_view)
: browser_view_(browser_view), : AnimationDelegateViews(browser_view),
browser_view_(browser_view),
view_(nullptr), view_(nullptr),
delegate_(nullptr), delegate_(nullptr),
focus_manager_(nullptr), focus_manager_(nullptr),
...@@ -192,7 +193,7 @@ void DropdownBarHost::OnDidChangeFocus(views::View* focused_before, ...@@ -192,7 +193,7 @@ void DropdownBarHost::OnDidChangeFocus(views::View* focused_before,
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// DropdownBarHost, gfx::AnimationDelegate implementation: // DropdownBarHost, views::AnimationDelegateViews implementation:
void DropdownBarHost::AnimationProgressed(const gfx::Animation* animation) { void DropdownBarHost::AnimationProgressed(const gfx::Animation* animation) {
// First, we calculate how many pixels to slide the widget. // First, we calculate how many pixels to slide the widget.
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/macros.h" #include "base/macros.h"
#include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/native_web_keyboard_event.h"
#include "ui/gfx/animation/animation_delegate.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
#include "ui/views/animation/animation_delegate_views.h"
#include "ui/views/focus/focus_manager.h" #include "ui/views/focus/focus_manager.h"
#include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_delegate.h"
...@@ -40,7 +40,7 @@ class View; ...@@ -40,7 +40,7 @@ class View;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
class DropdownBarHost : public ui::AcceleratorTarget, class DropdownBarHost : public ui::AcceleratorTarget,
public views::FocusChangeListener, public views::FocusChangeListener,
public gfx::AnimationDelegate, public views::AnimationDelegateViews,
public views::WidgetDelegate { public views::WidgetDelegate {
public: public:
explicit DropdownBarHost(BrowserView* browser_view); explicit DropdownBarHost(BrowserView* browser_view);
...@@ -87,7 +87,7 @@ class DropdownBarHost : public ui::AcceleratorTarget, ...@@ -87,7 +87,7 @@ class DropdownBarHost : public ui::AcceleratorTarget,
bool AcceleratorPressed(const ui::Accelerator& accelerator) override = 0; bool AcceleratorPressed(const ui::Accelerator& accelerator) override = 0;
bool CanHandleAccelerators() const override = 0; bool CanHandleAccelerators() const override = 0;
// gfx::AnimationDelegate implementation: // views::AnimationDelegateViews implementation:
void AnimationProgressed(const gfx::Animation* animation) override; void AnimationProgressed(const gfx::Animation* animation) override;
void AnimationEnded(const gfx::Animation* animation) override; void AnimationEnded(const gfx::Animation* animation) override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment