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

Issue 155789: Fix RTL: Omnibar - message "Press Tab to search Google" doesn't show correctly in a "New (Closed)

Created:
11 years, 5 months ago by xji
Modified:
9 years, 6 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews_googlegroups.com, Ben Goodger (Google), jungshik at Google, idana
Visibility:
Public.

Description

This CL fixes issue 2780 -- RTL: Omnibar - message "Press Tab to search Google" doesn't show correctly in a "New Tab" for RTL locales Because of the bug in PosFromChar() (see bug report for detailed information), we actually calculate the width of the string ourselves using font.GetStringWidth(). BUG=http://crbug.com/2780 TEST= 1 Start Chrome with a *new user data directory* and make sure the UI language is Hebrew. 2 Type www.google.com in the omnibox and press Enter. 3 Close and re-open the browser. 4 Type character "h" in Ominibox 5 Message "Press Tab to search Google" should show correctly, not only "Tab" is displayed Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=21312

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Total comments: 3

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 4

Patch Set 6 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -34 lines) Patch
M chrome/browser/views/location_bar_view.h View 5 1 chunk +12 lines, -10 lines 0 comments Download
M chrome/browser/views/location_bar_view.cc View 1 2 3 4 5 5 chunks +25 lines, -24 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
xji
Hi Peter, Thanks for the suggestion! Xiaomei
11 years, 5 months ago (2009-07-20 19:37:23 UTC) #1
Peter Kasting
Besides the comments below, two other things: * You should audit the rest of the ...
11 years, 5 months ago (2009-07-20 19:54:07 UTC) #2
xji
Hi Peter, Thanks for your review and valuable comments. I have some basic questions below. ...
11 years, 5 months ago (2009-07-20 22:37:00 UTC) #3
Peter Kasting
On 2009/07/20 22:37:00, xji wrote: > PosFromChar() does not always return wrong information. That doesn't ...
11 years, 5 months ago (2009-07-20 23:03:32 UTC) #4
xji
1. I prefer to clean PosFromChar() in another CL. 2. Tested font_.GetStringWidth() using Chinese, English, ...
11 years, 5 months ago (2009-07-21 01:31:37 UTC) #5
Peter Kasting
LGTM http://codereview.chromium.org/155789/diff/1005/1006 File chrome/browser/views/location_bar_view.cc (right): http://codereview.chromium.org/155789/diff/1005/1006#newcode489 Line 489: // PosFromChar(location_entry_->GetTextLength()) because PosFromChar() might Nit: "might ...
11 years, 5 months ago (2009-07-21 01:37:25 UTC) #6
xji
On 2009/07/21 01:37:25, pkasting wrote: > LGTM > > http://codereview.chromium.org/155789/diff/1005/1006 > File chrome/browser/views/location_bar_view.cc (right): > ...
11 years, 5 months ago (2009-07-21 19:05:09 UTC) #7
Peter Kasting
On 2009/07/21 19:05:09, xji wrote: > On 2009/07/21 01:37:25, pkasting wrote: > > http://codereview.chromium.org/155789/diff/1005/1006#newcode496 > ...
11 years, 5 months ago (2009-07-21 19:45:24 UTC) #8
xji
The return value of TextDisplayWidth() is used in several places. But all mainly for comparing ...
11 years, 5 months ago (2009-07-21 23:09:14 UTC) #9
Peter Kasting
On 2009/07/21 23:09:14, xji wrote: > The return value of TextDisplayWidth() is used in several ...
11 years, 5 months ago (2009-07-21 23:18:37 UTC) #10
xji
I've uploaded a CL as you suggested. But I still feel previous version is better ...
11 years, 5 months ago (2009-07-22 01:03:02 UTC) #11
Peter Kasting
11 years, 5 months ago (2009-07-22 02:17:02 UTC) #12
LGTM

http://codereview.chromium.org/155789/diff/1014/11
File chrome/browser/views/location_bar_view.cc (right):

http://codereview.chromium.org/155789/diff/1014/11#newcode423
Line 423: const int remaining_width = RemainingWidthExceptText(max_edit_width);
Nit: just roll this call into the line below that uses it instead of creating a
temp.

http://codereview.chromium.org/155789/diff/1014/11#newcode550
Line 550: int remaining_width, gfx::Rect* bounds) {
Nit: I think it'd be better if each argument got its own line.

http://codereview.chromium.org/155789/diff/1014/12
File chrome/browser/views/location_bar_view.h (right):

http://codereview.chromium.org/155789/diff/1014/12#newcode386
Line 386: // Returns the remaining width in pixels left for a view in edit.
Nit: This comment and function name make no sense.  How about:

// Returns the amount of horizontal space (in pixels) out of
|location_bar_width| that is not taken up by the actual text in
|location_entry_|.

(Then you can rename the various args below |available_width|.)
int AvailableWidth(int location_bar_width);

http://codereview.chromium.org/155789/diff/1014/12#newcode389
Line 389: // Returns true if the preferred size should be used for a view whose
width
Nit: How about rewriting this unclear comment as follows:

// Returns whether the |available_width| is large enough to contain a view with
preferred width |pref_width| at its preferred size.

Powered by Google App Engine
This is Rietveld 408576698