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

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

Issue 103493003: Revert of Implement eliding/truncating at end in RenderText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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_RESULT_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "chrome/browser/autocomplete/autocomplete_match.h" 10 #include "chrome/browser/autocomplete/autocomplete_match.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 static void CommonInitColors(const ui::NativeTheme* theme, 104 static void CommonInitColors(const ui::NativeTheme* theme,
105 SkColor colors[][NUM_KINDS]); 105 SkColor colors[][NUM_KINDS]);
106 106
107 // Predicate functions for use when sorting the runs. 107 // Predicate functions for use when sorting the runs.
108 static bool SortRunsLogically(const RunData& lhs, const RunData& rhs); 108 static bool SortRunsLogically(const RunData& lhs, const RunData& rhs);
109 static bool SortRunsVisually(const RunData& lhs, const RunData& rhs); 109 static bool SortRunsVisually(const RunData& lhs, const RunData& rhs);
110 110
111 gfx::ImageSkia GetIcon() const; 111 gfx::ImageSkia GetIcon() const;
112 const gfx::ImageSkia* GetKeywordIcon() const; 112 const gfx::ImageSkia* GetKeywordIcon() const;
113 113
114 // Elides |runs| to fit in |remaining_width|. The runs in |runs| should be in
115 // logical order.
116 //
117 // When we need to elide a run, the ellipsis will be placed at the end of that
118 // run. This means that if we elide a run whose visual direction is opposite
119 // that of the drawing context, the ellipsis will not be at the "end" of the
120 // drawn string. For example, if in an LTR context we have the LTR run
121 // "LTR_STRING" and the RTL run "RTL_STRING", the unelided text would be drawn
122 // like:
123 // LTR_STRING GNIRTS_LTR
124 // If we need to elide the RTL run, then it will be drawn like:
125 // LTR_STRING ...RTS_LTR
126 // Instead of:
127 // LTR_STRING RTS_LTR...
128 void Elide(Runs* runs, int remaining_width) const;
129
114 // views::View: 130 // views::View:
115 virtual void Layout() OVERRIDE; 131 virtual void Layout() OVERRIDE;
116 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; 132 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
117 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 133 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
118 134
119 // gfx::AnimationDelegate: 135 // gfx::AnimationDelegate:
120 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; 136 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
121 137
122 static int default_icon_size_; 138 static int default_icon_size_;
123 139
(...skipping 25 matching lines...) Expand all
149 165
150 gfx::Rect keyword_text_bounds_; 166 gfx::Rect keyword_text_bounds_;
151 scoped_ptr<views::ImageView> keyword_icon_; 167 scoped_ptr<views::ImageView> keyword_icon_;
152 168
153 scoped_ptr<gfx::SlideAnimation> animation_; 169 scoped_ptr<gfx::SlideAnimation> animation_;
154 170
155 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); 171 DISALLOW_COPY_AND_ASSIGN(OmniboxResultView);
156 }; 172 };
157 173
158 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_ 174 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_RESULT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698