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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc

Issue 11360144: Converts some of the omnibox related classes to support multiple (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unneeded include Created 8 years, 1 month 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
Index: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
index 759728130d57c1c0a407b5d8cf5302e2e534f043..acf9db0388a09205c33128efa1fd6ab7b78e8c4f 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
@@ -160,8 +160,7 @@ bool OmniboxPopupContentsView::IsOpen() const {
}
void OmniboxPopupContentsView::InvalidateLine(size_t line) {
- OmniboxResultView* result = static_cast<OmniboxResultView*>(
- child_at(static_cast<int>(line)));
+ OmniboxResultView* result = result_view_at(line);
result->Invalidate();
if (HasMatchAt(line) && GetMatchAtIndex(line).associated_keyword.get()) {
@@ -191,7 +190,7 @@ void OmniboxPopupContentsView::UpdatePopupAppearance() {
size_t child_rv_count = child_count();
const size_t result_size = model_->result().size();
for (size_t i = 0; i < result_size; ++i) {
- OmniboxResultView* view = static_cast<OmniboxResultView*>(child_at(i));
+ OmniboxResultView* view = result_view_at(i);
view->SetMatch(GetMatchAtIndex(i));
view->SetVisible(true);
}
@@ -382,7 +381,7 @@ ui::EventResult OmniboxPopupContentsView::OnGestureEvent(
// OmniboxPopupContentsView, protected:
void OmniboxPopupContentsView::PaintResultViews(gfx::Canvas* canvas) {
- canvas->DrawColor(OmniboxResultView::GetColor(
+ canvas->DrawColor(result_view_at(0)->GetColor(
OmniboxResultView::NORMAL, OmniboxResultView::BACKGROUND));
View::PaintChildren(canvas);
}
@@ -486,7 +485,7 @@ void OmniboxPopupContentsView::MakeCanvasTransparent(gfx::Canvas* canvas) {
SkAlpha alpha = GetThemeProvider()->ShouldUseNativeFrame() ?
kGlassPopupAlpha : kOpaquePopupAlpha;
canvas->DrawColor(SkColorSetA(
- OmniboxResultView::GetColor(OmniboxResultView::NORMAL,
+ result_view_at(0)->GetColor(OmniboxResultView::NORMAL,
OmniboxResultView::BACKGROUND), alpha), SkXfermode::kDstIn_Mode);
}
@@ -557,3 +556,7 @@ void OmniboxPopupContentsView::OpenSelectedLine(
size_t index = GetIndexForPoint(event.location());
OpenIndex(index, disposition);
}
+
+OmniboxResultView* OmniboxPopupContentsView::result_view_at(int i) {
Peter Kasting 2012/11/09 21:21:11 Nit: Callers pass a size_t, maybe this should take
sky 2012/11/09 21:28:55 Done.
+ return static_cast<OmniboxResultView*>(child_at(i));
+}
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h ('k') | chrome/browser/ui/views/omnibox/omnibox_result_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698