| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_vector.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete.h" | 10 #include "chrome/browser/autocomplete/autocomplete.h" |
| 10 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 11 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
| 11 #include "chrome/browser/autocomplete/autocomplete_popup_view.h" | 12 #include "chrome/browser/autocomplete/autocomplete_popup_view.h" |
| 12 #include "chrome/browser/ui/views/autocomplete/autocomplete_result_view_model.h" | 13 #include "chrome/browser/ui/views/autocomplete/autocomplete_result_view_model.h" |
| 13 #include "ui/base/animation/animation_delegate.h" | 14 #include "ui/base/animation/animation_delegate.h" |
| 14 #include "ui/base/animation/slide_animation.h" | 15 #include "ui/base/animation/slide_animation.h" |
| 15 #include "ui/gfx/font.h" | 16 #include "ui/gfx/font.h" |
| 16 #include "views/view.h" | 17 #include "views/view.h" |
| 17 #include "webkit/glue/window_open_disposition.h" | 18 #include "webkit/glue/window_open_disposition.h" |
| 18 | 19 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; | 95 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; |
| 95 | 96 |
| 96 scoped_ptr<AutocompletePopupModel> model_; | 97 scoped_ptr<AutocompletePopupModel> model_; |
| 97 | 98 |
| 98 // The "Opt-in to Instant" promo view, if there is one. | 99 // The "Opt-in to Instant" promo view, if there is one. |
| 99 views::View* opt_in_view_; | 100 views::View* opt_in_view_; |
| 100 | 101 |
| 101 private: | 102 private: |
| 102 class AutocompletePopupWidget; | 103 class AutocompletePopupWidget; |
| 103 class InstantOptInView; | 104 class InstantOptInView; |
| 105 typedef ScopedVector<ui::SlideAnimation> SlideAnimations; |
| 104 | 106 |
| 105 // Returns true if the model has a match at the specified index. | 107 // Returns true if the model has a match at the specified index. |
| 106 bool HasMatchAt(size_t index) const; | 108 bool HasMatchAt(size_t index) const; |
| 107 | 109 |
| 108 // Returns the match at the specified index within the popup model. | 110 // Returns the match at the specified index within the popup model. |
| 109 const AutocompleteMatch& GetMatchAtIndex(size_t index) const; | 111 const AutocompleteMatch& GetMatchAtIndex(size_t index) const; |
| 110 | 112 |
| 111 // Fill a path for the contents' roundrect. |bounding_rect| is the rect that | 113 // Fill a path for the contents' roundrect. |bounding_rect| is the rect that |
| 112 // bounds the path. | 114 // bounds the path. |
| 113 void MakeContentsPath(gfx::Path* path, const gfx::Rect& bounding_rect); | 115 void MakeContentsPath(gfx::Path* path, const gfx::Rect& bounding_rect); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // flag is reset to false on a mouse pressed event, to make sure we don't | 165 // flag is reset to false on a mouse pressed event, to make sure we don't |
| 164 // erroneously ignore the next drag. | 166 // erroneously ignore the next drag. |
| 165 bool ignore_mouse_drag_; | 167 bool ignore_mouse_drag_; |
| 166 | 168 |
| 167 // The popup sizes vertically using an animation when the popup is getting | 169 // The popup sizes vertically using an animation when the popup is getting |
| 168 // shorter (not larger, that makes it look "slow"). | 170 // shorter (not larger, that makes it look "slow"). |
| 169 ui::SlideAnimation size_animation_; | 171 ui::SlideAnimation size_animation_; |
| 170 gfx::Rect start_bounds_; | 172 gfx::Rect start_bounds_; |
| 171 gfx::Rect target_bounds_; | 173 gfx::Rect target_bounds_; |
| 172 | 174 |
| 175 // A list of animations for each result line. The animation is used to |
| 176 // gracefully switch between the result view and the keyword view for |
| 177 // each line. |
| 178 SlideAnimations keyword_animations_; |
| 179 |
| 173 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); | 180 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); |
| 174 }; | 181 }; |
| 175 | 182 |
| 176 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW
_H_ | 183 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW
_H_ |
| OLD | NEW |