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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h

Issue 1016033011: omnibox: Don't paint children from inside OnPaint(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698