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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/omnibox/omnibox_result_view.h
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.h b/chrome/browser/ui/views/omnibox/omnibox_result_view.h
index 886e1d5efaa6cc2c033d9b47d7112afb63b7024e..07167bfe6fc4b7de1e38fd479d86d8be6564248a 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_result_view.h
+++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.h
@@ -111,6 +111,22 @@
gfx::ImageSkia GetIcon() const;
const gfx::ImageSkia* GetKeywordIcon() const;
+ // Elides |runs| to fit in |remaining_width|. The runs in |runs| should be in
+ // logical order.
+ //
+ // When we need to elide a run, the ellipsis will be placed at the end of that
+ // run. This means that if we elide a run whose visual direction is opposite
+ // that of the drawing context, the ellipsis will not be at the "end" of the
+ // drawn string. For example, if in an LTR context we have the LTR run
+ // "LTR_STRING" and the RTL run "RTL_STRING", the unelided text would be drawn
+ // like:
+ // LTR_STRING GNIRTS_LTR
+ // If we need to elide the RTL run, then it will be drawn like:
+ // LTR_STRING ...RTS_LTR
+ // Instead of:
+ // LTR_STRING RTS_LTR...
+ void Elide(Runs* runs, int remaining_width) const;
+
// views::View:
virtual void Layout() OVERRIDE;
virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698