| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_OMNIBOX_OMNIBOX_POPUP_CONTENTS_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_POPUP_CONTENTS_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_POPUP_CONTENTS_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_POPUP_CONTENTS_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 9 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
| 10 #include "chrome/browser/ui/omnibox/omnibox_popup_view.h" | 10 #include "chrome/browser/ui/omnibox/omnibox_popup_view.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // Calculates the height needed to show all the results in the model. | 86 // Calculates the height needed to show all the results in the model. |
| 87 virtual int CalculatePopupHeight(); | 87 virtual int CalculatePopupHeight(); |
| 88 virtual OmniboxResultView* CreateResultView(int model_index, | 88 virtual OmniboxResultView* CreateResultView(int model_index, |
| 89 const gfx::FontList& font_list); | 89 const gfx::FontList& font_list); |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 class AutocompletePopupWidget; | 92 class AutocompletePopupWidget; |
| 93 | 93 |
| 94 // views::View: | 94 // views::View: |
| 95 const char* GetClassName() const override; | 95 const char* GetClassName() const override; |
| 96 void OnPaint(gfx::Canvas* canvas) override; | |
| 97 // This method should not be triggered directly as we paint our children | |
| 98 // in an un-conventional way inside OnPaint. We use a separate canvas to | |
| 99 // paint the children. Hence we override this method to a no-op so that | |
| 100 // the view hierarchy does not "accidentally" trigger this. | |
| 101 void PaintChildren(gfx::Canvas* canvas, | 96 void PaintChildren(gfx::Canvas* canvas, |
| 102 const views::CullSet& cull_set) override; | 97 const views::CullSet& cull_set) override; |
| 103 | 98 |
| 104 // views::ViewTargeterDelegate: | 99 // views::ViewTargeterDelegate: |
| 105 views::View* TargetForRect(views::View* root, const gfx::Rect& rect) override; | 100 views::View* TargetForRect(views::View* root, const gfx::Rect& rect) override; |
| 106 | 101 |
| 107 // Call immediately after construction. | 102 // Call immediately after construction. |
| 108 void Init(); | 103 void Init(); |
| 109 | 104 |
| 110 // Returns true if the model has a match at the specified index. | 105 // Returns true if the model has a match at the specified index. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 166 |
| 172 // When the dropdown is not wide enough while displaying postfix suggestions, | 167 // When the dropdown is not wide enough while displaying postfix suggestions, |
| 173 // we use the width of widest match contents to shift the suggestions so that | 168 // we use the width of widest match contents to shift the suggestions so that |
| 174 // the widest suggestion just reaches the end edge. | 169 // the widest suggestion just reaches the end edge. |
| 175 int max_match_contents_width_; | 170 int max_match_contents_width_; |
| 176 | 171 |
| 177 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupContentsView); | 172 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupContentsView); |
| 178 }; | 173 }; |
| 179 | 174 |
| 180 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_POPUP_CONTENTS_VIEW_H_ | 175 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_POPUP_CONTENTS_VIEW_H_ |
| OLD | NEW |