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

Side by Side Diff: chrome/browser/ui/views/omnibox/touch_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: win_initialized 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/ui/views/omnibox/touch_omnibox_popup_contents_view.h" 5 #include "chrome/browser/ui/views/omnibox/touch_omnibox_popup_contents_view.h"
6 6
7 #include "chrome/browser/ui/omnibox/omnibox_view.h" 7 #include "chrome/browser/ui/omnibox/omnibox_view.h"
8 #include "third_party/skia/include/core/SkPaint.h" 8 #include "third_party/skia/include/core/SkPaint.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/gfx/font.h" 10 #include "ui/gfx/font.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 // Draw a line at the bottom of each child except the last. The 82 // Draw a line at the bottom of each child except the last. The
83 // color of the line is determined to blend appropriately with the 83 // color of the line is determined to blend appropriately with the
84 // most dominant of the two surrounding cells, in precedence order, 84 // most dominant of the two surrounding cells, in precedence order,
85 // i.e. selected > hovered > normal. 85 // i.e. selected > hovered > normal.
86 for (std::vector<View*>::const_iterator i(visible_children.begin()); 86 for (std::vector<View*>::const_iterator i(visible_children.begin());
87 i + 1 != visible_children.end(); ++i) { 87 i + 1 != visible_children.end(); ++i) {
88 TouchOmniboxResultView* child = static_cast<TouchOmniboxResultView*>(*i); 88 TouchOmniboxResultView* child = static_cast<TouchOmniboxResultView*>(*i);
89 TouchOmniboxResultView* next_child = 89 TouchOmniboxResultView* next_child =
90 static_cast<TouchOmniboxResultView*>(*(i + 1)); 90 static_cast<TouchOmniboxResultView*>(*(i + 1));
91 SkColor divider_color = OmniboxResultView::GetColor( 91 SkColor divider_color = child->GetColor(
92 std::max(child->GetState(), next_child->GetState()), 92 std::max(child->GetState(), next_child->GetState()),
93 OmniboxResultView::DIVIDER); 93 OmniboxResultView::DIVIDER);
94 int line_y = child->y() + child->height() - 1; 94 int line_y = child->y() + child->height() - 1;
95 canvas->DrawLine(gfx::Point(bounds.x(), line_y), 95 canvas->DrawLine(gfx::Point(bounds.x(), line_y),
96 gfx::Point(bounds.right(), line_y), divider_color); 96 gfx::Point(bounds.right(), line_y), divider_color);
97 } 97 }
98 } 98 }
99 99
100 OmniboxResultView* TouchOmniboxPopupContentsView::CreateResultView( 100 OmniboxResultView* TouchOmniboxPopupContentsView::CreateResultView(
101 OmniboxResultViewModel* model, 101 OmniboxResultViewModel* model,
102 int model_index, 102 int model_index,
103 const gfx::Font& font, 103 const gfx::Font& font,
104 const gfx::Font& bold_font) { 104 const gfx::Font& bold_font) {
105 return new TouchOmniboxResultView(model, model_index, font, bold_font); 105 return new TouchOmniboxResultView(model, model_index, font, bold_font);
106 } 106 }
107 107
108 std::vector<views::View*> TouchOmniboxPopupContentsView::GetVisibleChildren() { 108 std::vector<views::View*> TouchOmniboxPopupContentsView::GetVisibleChildren() {
109 std::vector<View*> visible_children; 109 std::vector<View*> visible_children;
110 for (int i = 0; i < child_count(); ++i) { 110 for (int i = 0; i < child_count(); ++i) {
111 View* v = child_at(i); 111 View* v = child_at(i);
112 if (child_at(i)->visible()) 112 if (child_at(i)->visible())
113 visible_children.push_back(v); 113 visible_children.push_back(v);
114 } 114 }
115 return visible_children; 115 return visible_children;
116 } 116 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698