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

Unified Diff: chrome/browser/ui/views/page_info_bubble_view.cc

Issue 10826126: Show the leading Section headline text in PageInfoBubbleView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Set the selection range in Layout. Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/page_info_bubble_view.cc
diff --git a/chrome/browser/ui/views/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info_bubble_view.cc
index 02fb812fb97745a850f318caeedc77d7cdba924b..af45e6721a1cd8e3670d34d7f8089bef13053f47 100644
--- a/chrome/browser/ui/views/page_info_bubble_view.cc
+++ b/chrome/browser/ui/views/page_info_bubble_view.cc
@@ -20,6 +20,7 @@
#include "grit/locale_settings.h"
#include "net/base/x509_certificate.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/range/range.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image.h"
#include "ui/views/controls/image_view.h"
@@ -424,6 +425,12 @@ gfx::Size Section::LayoutItems(bool compute_bounds_only, int width) {
if (!compute_bounds_only)
headline_label_->SetBounds(x, y, w > 0 ? w : 0, size.height());
y += size.height();
+
+ // Show the leading headline text by moving the textfield cursor there,
+ // otherwise long headlines may initially show the leading text truncated.
+ // This can only be done after the textfield is initialized with the Widget.
+ if (GetWidget())
+ headline_label_->SelectRange(ui::Range());
Peter Kasting 2012/08/03 19:20:37 I don't think this is the right fix. Instead, the
msw 2012/08/03 20:10:19 This fixes the regression and brings us to parity
} else {
if (!compute_bounds_only)
headline_label_->SetBounds(x, y, 0, 0);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698