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

Side by Side Diff: chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc

Issue 7607007: Add confidence to AutocompleteMatch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm ('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) 2011 The Chromium Authors. All rights reserved. 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 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 // For WinDDK ATL compatibility, these ATL headers must come first. 5 // For WinDDK ATL compatibility, these ATL headers must come first.
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <atlbase.h> // NOLINT 8 #include <atlbase.h> // NOLINT
9 #include <atlwin.h> // NOLINT 9 #include <atlwin.h> // NOLINT
10 #endif 10 #endif
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 AutocompleteResultView::AutocompleteResultView( 109 AutocompleteResultView::AutocompleteResultView(
110 AutocompleteResultViewModel* model, 110 AutocompleteResultViewModel* model,
111 int model_index, 111 int model_index,
112 const gfx::Font& font, 112 const gfx::Font& font,
113 const gfx::Font& bold_font) 113 const gfx::Font& bold_font)
114 : model_(model), 114 : model_(model),
115 model_index_(model_index), 115 model_index_(model_index),
116 normal_font_(font), 116 normal_font_(font),
117 bold_font_(bold_font), 117 bold_font_(bold_font),
118 ellipsis_width_(font.GetStringWidth(string16(kEllipsis))), 118 ellipsis_width_(font.GetStringWidth(string16(kEllipsis))),
119 mirroring_context_(new MirroringContext()), 119 mirroring_context_(new MirroringContext()) {
120 match_(NULL, 0, false, AutocompleteMatch::URL_WHAT_YOU_TYPED) {
121 CHECK_GE(model_index, 0); 120 CHECK_GE(model_index, 0);
122 if (default_icon_size_ == 0) { 121 if (default_icon_size_ == 0) {
123 default_icon_size_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( 122 default_icon_size_ = ResourceBundle::GetSharedInstance().GetBitmapNamed(
124 AutocompleteMatch::TypeToIcon(AutocompleteMatch::URL_WHAT_YOU_TYPED))-> 123 AutocompleteMatch::TypeToIcon(AutocompleteMatch::URL_WHAT_YOU_TYPED))->
125 width(); 124 width();
126 } 125 }
127 } 126 }
128 127
129 AutocompleteResultView::~AutocompleteResultView() { 128 AutocompleteResultView::~AutocompleteResultView() {
130 } 129 }
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 520
522 // Paint the icon. 521 // Paint the icon.
523 canvas->DrawBitmapInt(*GetIcon(), GetMirroredXForRect(icon_bounds_), 522 canvas->DrawBitmapInt(*GetIcon(), GetMirroredXForRect(icon_bounds_),
524 icon_bounds_.y()); 523 icon_bounds_.y());
525 524
526 // Paint the text. 525 // Paint the text.
527 int x = GetMirroredXForRect(text_bounds_); 526 int x = GetMirroredXForRect(text_bounds_);
528 mirroring_context_->Initialize(x, text_bounds_.width()); 527 mirroring_context_->Initialize(x, text_bounds_.width());
529 PaintMatch(canvas, match_, x); 528 PaintMatch(canvas, match_, x);
530 } 529 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698