| Index: views/bubble/bubble_view.h
|
| diff --git a/views/bubble/bubble_view.h b/views/bubble/bubble_view.h
|
| index 948b39f2f3b4b4d29800ea0001a5265712f17371..2148e661d97b382529cdfb5195f10af8e8c32624 100644
|
| --- a/views/bubble/bubble_view.h
|
| +++ b/views/bubble/bubble_view.h
|
| @@ -6,14 +6,8 @@
|
| #define VIEWS_BUBBLE_BUBBLE_VIEW_H_
|
| #pragma once
|
|
|
| -#include <string>
|
| -
|
| -#include "base/gtest_prod_util.h"
|
| -#include "third_party/skia/include/core/SkColor.h"
|
| #include "ui/base/animation/animation_delegate.h"
|
| #include "views/accelerator.h"
|
| -#include "views/focus/focus_manager.h"
|
| -#include "views/view.h"
|
| #include "views/window/client_view.h"
|
|
|
| namespace ui {
|
| @@ -22,62 +16,33 @@ class SlideAnimation;
|
|
|
| namespace views {
|
|
|
| -// To show a bubble:
|
| -// - Call Show() explicitly. This will not start a fading animation.
|
| -// - Call StartFade() this starts a fading out sequence that will be
|
| -// cut short on VKEY_ESCAPE.
|
| class VIEWS_EXPORT BubbleView : public ClientView,
|
| public ui::AnimationDelegate {
|
| public:
|
| - BubbleView(Widget* widget, View* contents_view);
|
| + BubbleView(Widget* widget,
|
| + View* contents_view,
|
| + bool enable_accelerator);
|
| virtual ~BubbleView();
|
|
|
| - // Starts a fade (out) animation. Unless this method is called, bubble will
|
| - // stay until ui::VKEY_ESCAPE is sent.
|
| - void StartFade();
|
| -
|
| - // Shows the bubble.
|
| - void Show();
|
| -
|
| - void set_animation_delegate(ui::AnimationDelegate* delegate);
|
| + // ClientView overrides:
|
| + virtual BubbleView* AsBubbleView() OVERRIDE { return this; }
|
| + virtual const BubbleView* AsBubbleView() const OVERRIDE { return this; }
|
|
|
| - virtual BubbleView* AsBubbleView() OVERRIDE;
|
| - virtual const BubbleView* AsBubbleView() const OVERRIDE;
|
| + // Starts a fade-out animation, which closes the widget upon completion.
|
| + void StartFade();
|
|
|
| protected:
|
| - virtual void ViewHierarchyChanged(bool is_add,
|
| - views::View* parent,
|
| - views::View* child) OVERRIDE;
|
| -
|
| + // View overrides:
|
| virtual bool AcceleratorPressed(const Accelerator& accelerator) OVERRIDE;
|
| - virtual void Layout() OVERRIDE;
|
| - virtual gfx::Size GetPreferredSize() OVERRIDE;
|
|
|
| private:
|
| - FRIEND_TEST(BubbleViewTest, FadeAnimation);
|
| -
|
| - void InitAnimation();
|
| -
|
| - // Sets up the layout manager based on currently initialized views. Should be
|
| - // called when a view is initialized or changed.
|
| - void ResetLayoutManager();
|
| -
|
| - // Close bubble when animation ended.
|
| + // ui::AnimationDelegate overrides:
|
| virtual void AnimationEnded(const ui::Animation* animation);
|
| -
|
| - // notify on animation progress.
|
| virtual void AnimationProgressed(const ui::Animation* animation);
|
|
|
| // Fade animation for bubble.
|
| scoped_ptr<ui::SlideAnimation> fade_animation_;
|
|
|
| - // Not owned.
|
| - ui::AnimationDelegate* animation_delegate_;
|
| -
|
| - bool registered_accelerator_;
|
| -
|
| - bool should_fade_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(BubbleView);
|
| };
|
|
|
|
|