Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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_V IEW_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_TOUCH_AUTOCOMPLETE_POPUP_CONTENTS_V IEW_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 | |
| 12 class AutocompleteEditView; | |
| 13 class AutocompleteEditModel; | |
| 14 class Profile; | |
| 15 | |
| 16 namespace gfx { | |
| 17 class Canvas; | |
| 18 class CanvasSkia; | |
| 19 } | |
| 20 | |
| 21 namespace views { | |
| 22 class View; | |
| 23 } | |
| 24 | |
| 25 class 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 virtual ~TouchAutocompleteResultView(); | |
| 32 | |
| 33 // AutocompleteResultView overrides. | |
|
Peter Kasting
2011/02/17 23:08:57
Nit: In new code I prefer just the classname plus
varunjain
2011/02/18 00:16:34
Done.
| |
| 34 virtual void Layout(); | |
|
Peter Kasting
2011/02/17 23:08:57
Nit: Can all the public and protected functions in
varunjain
2011/02/18 00:16:34
Done.
| |
| 35 virtual gfx::Size GetPreferredSize(); | |
| 36 | |
| 37 protected: | |
| 38 virtual void PaintMatch(gfx::Canvas* canvas, | |
| 39 const AutocompleteMatch& match, | |
| 40 int x); | |
| 41 | |
| 42 private: | |
| 43 int GetFontHeight() const; | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(TouchAutocompleteResultView); | |
| 46 }; | |
| 47 | |
| 48 class TouchAutocompletePopupContentsView: public AutocompletePopupContentsView { | |
|
Peter Kasting
2011/02/17 23:08:57
Nit: Space before ':'
varunjain
2011/02/18 00:16:34
Done.
| |
| 49 public: | |
| 50 TouchAutocompletePopupContentsView(const gfx::Font& font, | |
| 51 AutocompleteEditView* edit_view, | |
| 52 AutocompleteEditModel* edit_model, | |
| 53 Profile* profile, | |
| 54 const views::View* location_bar); | |
| 55 virtual ~TouchAutocompletePopupContentsView(); | |
| 56 | |
| 57 // AutocompletePopupContentsView overrides. | |
| 58 virtual void UpdatePopupAppearance(); | |
| 59 virtual void PaintChildren(gfx::CanvasSkia* canvas); | |
| 60 virtual void LayoutChildren(); | |
| 61 | |
| 62 protected: | |
| 63 // AutocompletePopupContentsView overrides. | |
| 64 virtual int CalculatePopupHeight(); | |
| 65 virtual AutocompleteResultView* CreateResultView( | |
| 66 AutocompleteResultViewModel* model, | |
| 67 int model_index, | |
| 68 const gfx::Font& font, | |
| 69 const gfx::Font& bold_font); | |
| 70 | |
| 71 private: | |
| 72 int GetVisibleChildCount() const; | |
|
Peter Kasting
2011/02/17 23:08:57
Nit: These two lines are indented too far
varunjain
2011/02/18 00:16:34
Done.
| |
| 73 | |
| 74 DISALLOW_COPY_AND_ASSIGN(TouchAutocompletePopupContentsView); | |
| 75 }; | |
| 76 | |
| 77 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_TOUCH_AUTOCOMPLETE_POPUP_CONTENT S_VIEW_H_ | |
| OLD | NEW |