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 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_TOUCH_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ 6#define CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_TOUCH_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ 7#pragma once 8 9#include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h" 10#include "chrome/browser/ui/views/autocomplete/autocomplete_result_view.h" 11 12class AutocompleteEditView; 13class AutocompleteEditModel; 14class Profile; 15 16namespace gfx { 17class Canvas; 18class CanvasSkia; 19} 20 21namespace views { 22class View; 23} 24 25class TouchAutocompleteResultView : public AutocompleteResultView { 26 public: 27 TouchAutocompleteResultView(AutocompleteResultViewModel* model, 28 int model_index, 29 const gfx::Font& font, 30 const gfx::Font& bold_font); 31 32 private: 33 virtual ~TouchAutocompleteResultView(); 34 35 // AutocompleteResultView: 36 virtual void PaintMatch(gfx::Canvas* canvas, 37 const AutocompleteMatch& match, 38 int x) OVERRIDE; 39 virtual int GetFontHeight() const OVERRIDE; 40 41 DISALLOW_COPY_AND_ASSIGN(TouchAutocompleteResultView); 42}; 43 44class TouchAutocompletePopupContentsView 45 : public AutocompletePopupContentsView { 46 public: 47 TouchAutocompletePopupContentsView(const gfx::Font& font, 48 AutocompleteEditView* edit_view, 49 AutocompleteEditModel* edit_model, 50 Profile* profile, 51 const views::View* location_bar); 52 virtual ~TouchAutocompletePopupContentsView(); 53 54 // AutocompletePopupContentsView: 55 virtual void UpdatePopupAppearance(); 56 virtual void LayoutChildren(); 57 58 protected: 59 // AutocompletePopupContentsView: 60 virtual void PaintResultViews(gfx::CanvasSkia* canvas); 61 virtual int CalculatePopupHeight(); 62 virtual AutocompleteResultView* CreateResultView( 63 AutocompleteResultViewModel* model, 64 int model_index, 65 const gfx::Font& font, 66 const gfx::Font& bold_font); 67 68 private: 69 std::vector<View*> GetVisibleChildren(); 70 71 DISALLOW_COPY_AND_ASSIGN(TouchAutocompletePopupContentsView); 72}; 73 74#endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_TOUCH_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ 75