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

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

Issue 312233003: Add fade eliding for Views Labels; related cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refine alignment check; minor additional cleanup. Created 6 years, 6 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
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 // 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 mirroring_context_->mirrored_left_coord(x, right_x), y, 332 mirroring_context_->mirrored_left_coord(x, right_x), y,
333 right_x - x, height())); 333 right_x - x, height()));
334 render_text->Draw(canvas); 334 render_text->Draw(canvas);
335 return right_x; 335 return right_x;
336 } 336 }
337 337
338 scoped_ptr<gfx::RenderText> OmniboxResultView::CreateRenderText( 338 scoped_ptr<gfx::RenderText> OmniboxResultView::CreateRenderText(
339 const base::string16& text) const { 339 const base::string16& text) const {
340 scoped_ptr<gfx::RenderText> render_text(gfx::RenderText::CreateInstance()); 340 scoped_ptr<gfx::RenderText> render_text(gfx::RenderText::CreateInstance());
341 render_text->SetCursorEnabled(false); 341 render_text->SetCursorEnabled(false);
342 render_text->SetElideBehavior(gfx::ELIDE_AT_END); 342 render_text->SetElideBehavior(gfx::ELIDE_TAIL);
343 render_text->SetFontList(font_list_); 343 render_text->SetFontList(font_list_);
344 render_text->SetText(text); 344 render_text->SetText(text);
345 return render_text.Pass(); 345 return render_text.Pass();
346 } 346 }
347 347
348 scoped_ptr<gfx::RenderText> OmniboxResultView::CreateClassifiedRenderText( 348 scoped_ptr<gfx::RenderText> OmniboxResultView::CreateClassifiedRenderText(
349 const base::string16& text, 349 const base::string16& text,
350 const ACMatchClassifications& classifications, 350 const ACMatchClassifications& classifications,
351 bool force_dim) const { 351 bool force_dim) const {
352 scoped_ptr<gfx::RenderText> render_text(CreateRenderText(text)); 352 scoped_ptr<gfx::RenderText> render_text(CreateRenderText(text));
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 } 555 }
556 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(), 556 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(),
557 keyword_description_rendertext_.get(), canvas, x); 557 keyword_description_rendertext_.get(), canvas, x);
558 } 558 }
559 } 559 }
560 560
561 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { 561 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) {
562 Layout(); 562 Layout();
563 SchedulePaint(); 563 SchedulePaint();
564 } 564 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/origin_chip_view.cc ('k') | chrome/browser/ui/views/profiles/avatar_menu_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698