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

Issue 8221027: Make views::Label and views::Link auto-color themselves to be readable over their background colo... (Closed)

Created:
9 years, 2 months ago by Peter Kasting
Modified:
9 years, 2 months ago
Reviewers:
sail, sky
CC:
chromium-reviews, asanka, stevenjb, jennb, nkostylev+watch_chromium.org, Randy Smith (Not in Mondays), tfarina, Erik does not do reviews, mihaip+watch_chromium.org, Dmitry Titov, dcheng, prasadt, Aaron Boodman, jianli, Paweł Hajdan Jr., davemoore+watch_chromium.org, dhollowa
Visibility:
Public.

Description

Make views::Label and views::Link auto-color themselves to be readable over their background color. Unfortunately since they can't automatically determine what that backgruond color is it has to be manually set. (I suppose I could try to add some crazy hierarchy-walking code looking for views::Background objects, but that seems like a bad move.) There is also a disable switch, which I use in a few places where I couldn't figure out what the background color actually is, or where updating it is really annoying. In theory, we might want to apply this to other controls like text buttons, but since those are usually rendered with explicit background images there's probably not a ton of win there. This also makes some other cleanup changes like converting a few wstrings to string16s, de-inlining some class member functions, etc. Some of these were mandated by the presubmitter :/ BUG=92 TEST=Things still look OK Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=105189

Patch Set 1 #

Total comments: 7

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 4

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1020 lines, -987 lines) Patch
M chrome/browser/chromeos/drop_shadow_label.h View 1 2 3 4 5 6 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/drop_shadow_label.cc View 1 2 3 4 5 6 2 chunks +10 lines, -21 lines 0 comments Download
M chrome/browser/chromeos/frame/panel_controller.cc View 1 2 3 4 5 6 3 chunks +8 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/input_method/candidate_window.cc View 1 2 3 4 5 6 20 chunks +80 lines, -56 lines 0 comments Download
M chrome/browser/chromeos/login/background_view.cc View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/message_bubble.cc View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/network_selection_view.cc View 1 2 3 4 5 6 4 chunks +13 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/new_user_view.h View 1 2 3 4 5 6 3 chunks +2 lines, -8 lines 0 comments Download
M chrome/browser/chromeos/login/new_user_view.cc View 1 2 3 4 5 6 6 chunks +28 lines, -30 lines 0 comments Download
M chrome/browser/chromeos/login/screen_lock_view.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/chromeos/login/update_view.h View 1 2 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/chromeos/login/update_view.cc View 1 2 3 4 5 6 3 chunks +21 lines, -15 lines 0 comments Download
M chrome/browser/chromeos/login/user_controller.cc View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/user_view.cc View 1 2 3 4 5 6 5 chunks +15 lines, -37 lines 0 comments Download
M chrome/browser/chromeos/login/username_view.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/chromeos/options/vpn_config_view.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/options/wifi_config_view.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/search_engines/template_url_fetcher.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/search_engines/template_url_fetcher_callbacks.h View 1 2 3 4 5 6 2 chunks +4 lines, -7 lines 0 comments Download
M chrome/browser/search_engines/template_url_fetcher_unittest.cc View 1 2 3 4 5 6 7 6 chunks +12 lines, -17 lines 0 comments Download
M chrome/browser/ui/browser.h View 1 2 3 4 5 6 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 6 1 chunk +4 lines, -5 lines 0 comments Download
M chrome/browser/ui/browser_window.h View 1 2 3 4 5 6 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/panels/panel.h View 1 2 3 4 5 6 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/panels/panel.cc View 1 2 3 4 5 6 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_frame_view.cc View 1 2 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/panels/panel_browser_view.cc View 1 2 3 4 5 6 3 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_view_browsertest.cc View 1 2 3 4 5 6 4 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h View 1 2 3 4 5 6 2 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/ui/search_engines/template_url_fetcher_ui_callbacks.h View 1 2 3 4 5 6 2 chunks +6 lines, -7 lines 0 comments Download
M chrome/browser/ui/search_engines/template_url_fetcher_ui_callbacks.cc View 1 2 3 4 5 6 1 chunk +3 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/about_chrome_view.cc View 1 2 3 4 5 6 6 chunks +15 lines, -12 lines 0 comments Download
M chrome/browser/ui/views/avatar_menu_bubble_view.cc View 1 2 3 4 5 6 6 chunks +178 lines, -152 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc View 1 2 3 4 5 6 3 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc View 1 2 3 4 5 6 7 chunks +9 lines, -19 lines 0 comments Download
M chrome/browser/ui/views/bubble/bubble.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/bubble/bubble.cc View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/default_search_view.h View 1 2 3 4 5 6 3 chunks +9 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/default_search_view.cc View 1 2 3 4 5 6 7 chunks +47 lines, -50 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view.cc View 1 2 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/download/download_shelf_view.h View 1 2 3 4 5 6 3 chunks +20 lines, -18 lines 0 comments Download
M chrome/browser/ui/views/download/download_shelf_view.cc View 1 2 3 4 5 6 4 chunks +45 lines, -42 lines 0 comments Download
M chrome/browser/ui/views/extensions/extension_install_dialog_view.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/find_bar_view.cc View 1 2 3 4 5 6 3 chunks +14 lines, -15 lines 0 comments Download
M chrome/browser/ui/views/first_run_bubble.cc View 1 2 3 4 5 6 7 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/ui/views/first_run_search_engine_view.h View 1 2 3 4 5 6 3 chunks +13 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/first_run_search_engine_view.cc View 1 2 3 4 5 6 7 chunks +168 lines, -160 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.h View 1 2 3 4 5 6 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 6 1 chunk +4 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/fullscreen_exit_bubble_views.cc View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/infobars/confirm_infobar.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/infobars/infobar_background.cc View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar_view.h View 1 2 3 4 5 6 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar_view.cc View 1 2 3 4 5 6 1 chunk +5 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/infobars/link_infobar.cc View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc View 1 2 3 4 5 6 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/location_bar/keyword_hint_view.h View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/location_bar/keyword_hint_view.cc View 1 2 3 4 5 6 4 chunks +13 lines, -9 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.cc View 1 2 3 4 5 6 2 chunks +0 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/location_bar/suggested_text_view.cc View 1 2 3 4 5 6 3 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/notifications/balloon_view.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/page_info_bubble_view.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/page_info_bubble_view.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/sad_tab_view.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/sad_tab_view.cc View 1 2 3 4 5 6 4 chunks +28 lines, -26 lines 0 comments Download
M chrome/browser/ui/views/wrench_menu.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M views/controls/label.h View 1 2 3 4 5 6 5 chunks +24 lines, -11 lines 0 comments Download
M views/controls/label.cc View 1 2 3 4 5 6 7 chunks +45 lines, -25 lines 0 comments Download
M views/controls/label_unittest.cc View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M views/controls/link.h View 1 2 3 4 5 6 1 chunk +11 lines, -18 lines 0 comments Download
M views/controls/link.cc View 1 2 3 4 5 6 5 chunks +56 lines, -91 lines 0 comments Download
M views/view_text_utils.cc View 1 2 3 4 5 6 3 chunks +2 lines, -10 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Peter Kasting
sail: Avatar menu changes (mostly just to de-inline function definitions) and FYI sky: Rest Scott, ...
9 years, 2 months ago (2011-10-10 23:41:56 UTC) #1
sail
LGTM! Sorry again for the merge issues. http://codereview.chromium.org/8221027/diff/1/chrome/browser/ui/views/avatar_menu_bubble_view.cc File chrome/browser/ui/views/avatar_menu_bubble_view.cc (right): http://codereview.chromium.org/8221027/diff/1/chrome/browser/ui/views/avatar_menu_bubble_view.cc#newcode191 chrome/browser/ui/views/avatar_menu_bubble_view.cc:191: edit_link_->SetEnabledColor(SkColorSetRGB(0xe3, 0xed, ...
9 years, 2 months ago (2011-10-10 23:49:34 UTC) #2
Peter Kasting
http://codereview.chromium.org/8221027/diff/1/chrome/browser/ui/views/avatar_menu_bubble_view.cc File chrome/browser/ui/views/avatar_menu_bubble_view.cc (right): http://codereview.chromium.org/8221027/diff/1/chrome/browser/ui/views/avatar_menu_bubble_view.cc#newcode191 chrome/browser/ui/views/avatar_menu_bubble_view.cc:191: edit_link_->SetEnabledColor(SkColorSetRGB(0xe3, 0xed, 0xf6)); On 2011/10/10 23:49:34, sail wrote: > ...
9 years, 2 months ago (2011-10-11 00:02:37 UTC) #3
sky
I only looked at label/link and want to rubber stamp the rest of the changes. ...
9 years, 2 months ago (2011-10-11 00:42:34 UTC) #4
Peter Kasting
Unfortunately, Scott, you should probably review everything. In particular, any place where I disable auto ...
9 years, 2 months ago (2011-10-11 01:05:47 UTC) #5
sky
9 years, 2 months ago (2011-10-11 14:54:10 UTC) #6
LGTM

http://codereview.chromium.org/8221027/diff/2027/chrome/browser/chromeos/logi...
File chrome/browser/chromeos/login/update_view.cc (right):

http://codereview.chromium.org/8221027/diff/2027/chrome/browser/chromeos/logi...
chrome/browser/chromeos/login/update_view.cc:221: void
UpdateView::InitLabel(views::Label** label, SkColor background_color) {
nit: out params should be last.

http://codereview.chromium.org/8221027/diff/2027/chrome/browser/chromeos/opti...
File chrome/browser/chromeos/options/vpn_config_view.cc (right):

http://codereview.chromium.org/8221027/diff/2027/chrome/browser/chromeos/opti...
chrome/browser/chromeos/options/vpn_config_view.cc:546:
error_label_->SetAutoColorReadabilityEnabled(false);
I tend to think you don't need this for the subclasses of
ChildNetworkConfigView, but I'm not positive. If you ask the author I'm sure
they could tell you.

http://codereview.chromium.org/8221027/diff/2027/chrome/browser/search_engine...
File chrome/browser/search_engines/template_url_fetcher_unittest.cc (right):

http://codereview.chromium.org/8221027/diff/2027/chrome/browser/search_engine...
chrome/browser/search_engines/template_url_fetcher_unittest.cc:33: Profile*
profile);
Since you're touching this code, how about adding OVERRIDE

http://codereview.chromium.org/8221027/diff/2027/chrome/browser/ui/search_eng...
File chrome/browser/ui/search_engines/template_url_fetcher_ui_callbacks.h
(right):

http://codereview.chromium.org/8221027/diff/2027/chrome/browser/ui/search_eng...
chrome/browser/ui/search_engines/template_url_fetcher_ui_callbacks.h:28:
Profile* profile);
OVERRIDE

Powered by Google App Engine
This is Rietveld 408576698