| Index: chrome/browser/ui/views/autocomplete/autocomplete_result_view.h
|
| ===================================================================
|
| --- chrome/browser/ui/views/autocomplete/autocomplete_result_view.h (revision 108642)
|
| +++ chrome/browser/ui/views/autocomplete/autocomplete_result_view.h (working copy)
|
| @@ -8,16 +8,23 @@
|
|
|
| #include "chrome/browser/autocomplete/autocomplete_match.h"
|
| #include "third_party/skia/include/core/SkColor.h"
|
| +#include "ui/base/animation/animation_delegate.h"
|
| +#include "ui/base/animation/slide_animation.h"
|
| #include "ui/gfx/font.h"
|
| #include "ui/gfx/rect.h"
|
| +#include "views/controls/button/image_button.h"
|
| #include "views/view.h"
|
|
|
| class AutocompleteResultViewModel;
|
| +class AutocompletePopupModel;
|
| +
|
| namespace gfx {
|
| class Canvas;
|
| }
|
|
|
| -class AutocompleteResultView : public views::View {
|
| +class AutocompleteResultView : public views::View,
|
| + private ui::AnimationDelegate,
|
| + private views::ButtonListener {
|
| public:
|
| enum ResultViewState {
|
| NORMAL = 0,
|
| @@ -34,6 +41,10 @@
|
| NUM_KINDS
|
| };
|
|
|
| + enum ViewID {
|
| + VIEW_ID_KEYWORD = 1,
|
| + };
|
| +
|
| AutocompleteResultView(AutocompleteResultViewModel* model,
|
| int model_index,
|
| const gfx::Font& font,
|
| @@ -47,6 +58,15 @@
|
| // model has changed.
|
| void SetMatch(const AutocompleteMatch& match);
|
|
|
| + void set_popup_model(AutocompletePopupModel* popup_model) {
|
| + popup_model_ = popup_model;
|
| + }
|
| +
|
| + void ShowKeyword(bool show_keyword);
|
| +
|
| + // views::View:
|
| + virtual gfx::Size GetPreferredSize() OVERRIDE;
|
| +
|
| protected:
|
| virtual void PaintMatch(gfx::Canvas* canvas,
|
| const AutocompleteMatch& match,
|
| @@ -100,14 +120,21 @@
|
| void Elide(Runs* runs, int remaining_width) const;
|
|
|
| // views::View:
|
| - virtual gfx::Size GetPreferredSize() OVERRIDE;
|
| virtual void Layout() OVERRIDE;
|
| virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
|
|
|
| + // ui::AnimationDelegate:
|
| + virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
|
| +
|
| + // views::ButtonListener:
|
| + virtual void ButtonPressed(views::Button* sender,
|
| + const views::Event& event) OVERRIDE;
|
| +
|
| static int default_icon_size_;
|
|
|
| // This row's model and model index.
|
| AutocompleteResultViewModel* model_;
|
| + AutocompletePopupModel* popup_model_;
|
| size_t model_index_;
|
|
|
| const gfx::Font normal_font_;
|
| @@ -125,6 +152,11 @@
|
| gfx::Rect text_bounds_;
|
| gfx::Rect icon_bounds_;
|
|
|
| + gfx::Rect keyword_text_bounds_;
|
| + scoped_ptr<views::ImageButton> keyword_button_;
|
| +
|
| + scoped_ptr<ui::SlideAnimation> animation_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(AutocompleteResultView);
|
| };
|
|
|
|
|