Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1320)

Unified Diff: chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h

Issue 6286092: Refactor AutocompletePopupContentView so that it can be extended to create (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fix merge conflicts Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h
diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h
index 6440a1e46d3189ba4202207bdaf9d2b7fbc3377b..b8e0986e7e7f5d65088525685a4785991b0480d7 100644
--- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h
+++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h
@@ -9,6 +9,7 @@
#include "chrome/browser/autocomplete/autocomplete.h"
#include "chrome/browser/autocomplete/autocomplete_popup_model.h"
#include "chrome/browser/autocomplete/autocomplete_popup_view.h"
+#include "chrome/browser/ui/views/autocomplete/autocomplete_result_view_model.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/gfx/font.h"
@@ -24,23 +25,13 @@
class AutocompleteEditModel;
class AutocompleteEditViewWin;
struct AutocompleteMatch;
+class AutocompleteResultView;
class BubbleBorder;
class Profile;
-// An interface implemented by an object that provides data to populate
-// individual result views.
-class AutocompleteResultViewModel {
- public:
- // Returns true if the index is selected.
- virtual bool IsSelectedIndex(size_t index) const = 0;
-
- // Returns true if the index is hovered.
- virtual bool IsHoveredIndex(size_t index) const = 0;
-
- // Returns the special-case icon we should use for the given index, or NULL
- // if we should use the default icon.
- virtual const SkBitmap* GetSpecialIcon(size_t index) const = 0;
-};
+namespace gfx {
+class Insets;
+}
// A view representing the contents of the autocomplete popup.
class AutocompletePopupContentsView : public views::View,
@@ -90,6 +81,15 @@ class AutocompletePopupContentsView : public views::View,
virtual bool OnMouseDragged(const views::MouseEvent& event);
virtual views::View* GetViewForPoint(const gfx::Point& point);
+ protected:
+ // Calculates the height needed to show all the results in the model.
+ virtual int CalculatePopupHeight();
+ virtual AutocompleteResultView* CreateResultView(
+ AutocompleteResultViewModel* model,
+ int model_index,
+ const gfx::Font& font,
+ const gfx::Font& bold_font);
+
private:
#if defined(OS_WIN)
typedef AutocompletePopupWin AutocompletePopupClass;
« no previous file with comments | « no previous file | chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698