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

Issue 239093007: Update Windows UI on system color changes. (Closed)

Created:
6 years, 8 months ago by msw
Modified:
6 years, 8 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, yukishiino+watch_chromium.org, tfarina, penghuang+watch_chromium.org, nona+watch_chromium.org, ben+views_chromium.org, James Su, dmazzoni
Visibility:
Public.

Description

Update Windows UI on system color changes. Propagate system theme (high contrast, etc.) changes throughout Views. (Win UI wasn't being notified; omnibox, find bar, etc. were broken, now aren't). (Linux Aura didn't update on changes with "Use Classic Theme", now it does). Make NativeTheme hold an observer list to be notified of changes. NotifyObservers of system color changes on Win via SysColorChangeListener. Nix NativeTheme duties for ThemeServiceAuraX11, and LinuxUI / Gtk2UI. Make Widget a NativeThemeObserver to call PropagateNativeThemeChanged. Start observing the relevant NativeTheme after native widget initialization. Make View::AddChildViewAt only update child views, not itself and siblings. (this was invoking redundant calls on itself as the parent and sibling views) Implement the BrowserView::OnNativeThemeChanged override. (update the frame and trigger a repaint with UserChangedTheme) (call MaybeShowInvertBubbleView, nix SysColorChangeListener impl) TODO(followup): Audit Views that need OnNativeThemeChanged overrides. BUG=134766 TEST=Win/Linux UI updates better when applying high contrast black/inverse system themes. R=erg@chromium.org, estade@chromium.org, sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266232

Patch Set 1 #

Patch Set 2 : Hack up a working change. #

Patch Set 3 : Make RootView a NativeThemeObserver instead. #

Patch Set 4 : Fix Linux Desktop and trigger BrowserView::UserChangedTheme. #

Patch Set 5 : Define the observer in native_theme.[h|cc], cleanup View. #

Patch Set 6 : Make the NativeTheme base class a SysColorChangeListener. #

Patch Set 7 : Sync and rebase. #

Total comments: 20

Patch Set 8 : Address comments. #

Patch Set 9 : Revert handling for NativeTheme instance 'changes'. #

Patch Set 10 : Make Widget the observer, address additional comments. #

Total comments: 4

Patch Set 11 : Address comments. #

Total comments: 8

Patch Set 12 : Address comments. #

Patch Set 13 : Sync and rebase; skip handling before BrowserView is initialized. #

Patch Set 14 : Sync and rebase again. #

Total comments: 2

Patch Set 15 : Add comment. #

Patch Set 16 : Restore change from bad rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+118 lines, -112 lines) Patch
M chrome/browser/themes/theme_service_aurax11.h View 1 2 chunks +1 line, -6 lines 0 comments Download
M chrome/browser/themes/theme_service_aurax11.cc View 1 2 3 2 chunks +2 lines, -15 lines 0 comments Download
M chrome/browser/ui/libgtk2ui/gtk2_border.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/ui/libgtk2ui/gtk2_border.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/ui/libgtk2ui/gtk2_ui.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +0 lines, -7 lines 0 comments Download
M chrome/browser/ui/libgtk2ui/gtk2_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +1 line, -13 lines 0 comments Download
M chrome/browser/ui/libgtk2ui/native_theme_gtk2.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/accessibility/invert_bubble_view.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +1 line, -7 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +9 lines, -6 lines 0 comments Download
M ui/gfx/sys_color_change_listener.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M ui/native_theme/native_theme.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +14 lines, -0 lines 0 comments Download
M ui/native_theme/native_theme.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +15 lines, -0 lines 0 comments Download
M ui/native_theme/native_theme.gyp View 1 2 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
A ui/native_theme/native_theme_observer.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +27 lines, -0 lines 0 comments Download
A + ui/native_theme/native_theme_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -4 lines 0 comments Download
M ui/native_theme/native_theme_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +1 line, -11 lines 0 comments Download
M ui/views/linux_ui/linux_ui.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +0 lines, -7 lines 0 comments Download
D ui/views/linux_ui/native_theme_change_observer.h View 1 1 chunk +0 lines, -23 lines 0 comments Download
M ui/views/view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M ui/views/views.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M ui/views/widget/widget.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +9 lines, -1 line 0 comments Download
M ui/views/widget/widget.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +11 lines, -1 line 0 comments Download

Messages

Total messages: 25 (0 generated)
msw
Hey Elliot and Scott, please take a look; thanks!
6 years, 8 months ago (2014-04-21 18:43:58 UTC) #1
Elliot Glaysher
Perhaps I'm misreading this, but this patch seems to conflict with estade's patch (https://codereview.chromium.org/243633003/) that ...
6 years, 8 months ago (2014-04-21 23:00:54 UTC) #2
msw
On 2014/04/21 23:00:54, Elliot Glaysher wrote: > Perhaps I'm misreading this, but this patch seems ...
6 years, 8 months ago (2014-04-21 23:35:52 UTC) #3
Evan Stade
https://codereview.chromium.org/239093007/diff/250001/ui/native_theme/native_theme.h File ui/native_theme/native_theme.h (right): https://codereview.chromium.org/239093007/diff/250001/ui/native_theme/native_theme.h#newcode24 ui/native_theme/native_theme.h:24: class NATIVE_THEME_EXPORT NativeThemeObserver { yea, this does conflict with ...
6 years, 8 months ago (2014-04-22 00:32:31 UTC) #4
msw - DO NOT USE
https://codereview.chromium.org/239093007/diff/250001/ui/native_theme/native_theme.h File ui/native_theme/native_theme.h (right): https://codereview.chromium.org/239093007/diff/250001/ui/native_theme/native_theme.h#newcode24 ui/native_theme/native_theme.h:24: class NATIVE_THEME_EXPORT NativeThemeObserver { On 2014/04/22 00:32:32, Evan Stade ...
6 years, 8 months ago (2014-04-22 01:16:44 UTC) #5
Evan Stade
https://codereview.chromium.org/239093007/diff/250001/chrome/browser/ui/views/accessibility/invert_bubble_view.cc File chrome/browser/ui/views/accessibility/invert_bubble_view.cc (right): https://codereview.chromium.org/239093007/diff/250001/chrome/browser/ui/views/accessibility/invert_bubble_view.cc#newcode18 chrome/browser/ui/views/accessibility/invert_bubble_view.cc:18: #include "ui/gfx/sys_color_change_listener.h" why is this needed? https://codereview.chromium.org/239093007/diff/250001/ui/native_theme/native_theme.cc File ui/native_theme/native_theme.cc ...
6 years, 8 months ago (2014-04-22 17:43:44 UTC) #6
msw
https://codereview.chromium.org/239093007/diff/250001/chrome/browser/ui/views/accessibility/invert_bubble_view.cc File chrome/browser/ui/views/accessibility/invert_bubble_view.cc (right): https://codereview.chromium.org/239093007/diff/250001/chrome/browser/ui/views/accessibility/invert_bubble_view.cc#newcode18 chrome/browser/ui/views/accessibility/invert_bubble_view.cc:18: #include "ui/gfx/sys_color_change_listener.h" On 2014/04/22 17:43:44, Evan Stade wrote: > ...
6 years, 8 months ago (2014-04-22 19:48:58 UTC) #7
Evan Stade
https://codereview.chromium.org/239093007/diff/250001/ui/native_theme/native_theme.cc File ui/native_theme/native_theme.cc (right): https://codereview.chromium.org/239093007/diff/250001/ui/native_theme/native_theme.cc#newcode45 ui/native_theme/native_theme.cc:45: OnNativeThemeChange(); On 2014/04/22 19:48:58, msw wrote: > On 2014/04/22 ...
6 years, 8 months ago (2014-04-22 21:09:17 UTC) #8
msw
Please take a fresh look; thanks. https://codereview.chromium.org/239093007/diff/250001/ui/native_theme/native_theme.cc File ui/native_theme/native_theme.cc (right): https://codereview.chromium.org/239093007/diff/250001/ui/native_theme/native_theme.cc#newcode45 ui/native_theme/native_theme.cc:45: OnNativeThemeChange(); On 2014/04/22 ...
6 years, 8 months ago (2014-04-23 00:34:03 UTC) #9
Evan Stade
https://codereview.chromium.org/239093007/diff/360001/chrome/browser/ui/libgtk2ui/gtk2_border.cc File chrome/browser/ui/libgtk2ui/gtk2_border.cc (right): https://codereview.chromium.org/239093007/diff/360001/chrome/browser/ui/libgtk2ui/gtk2_border.cc#newcode80 chrome/browser/ui/libgtk2ui/gtk2_border.cc:80: NativeThemeGtk2::instance()->AddObserver(this); nit: ScopedObserver https://codereview.chromium.org/239093007/diff/360001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/239093007/diff/360001/ui/views/widget/widget.cc#newcode1346 ui/views/widget/widget.cc:1346: ...
6 years, 8 months ago (2014-04-24 01:14:51 UTC) #10
msw
Comments addressed. https://codereview.chromium.org/239093007/diff/360001/chrome/browser/ui/libgtk2ui/gtk2_border.cc File chrome/browser/ui/libgtk2ui/gtk2_border.cc (right): https://codereview.chromium.org/239093007/diff/360001/chrome/browser/ui/libgtk2ui/gtk2_border.cc#newcode80 chrome/browser/ui/libgtk2ui/gtk2_border.cc:80: NativeThemeGtk2::instance()->AddObserver(this); On 2014/04/24 01:14:52, Evan Stade wrote: ...
6 years, 8 months ago (2014-04-24 18:32:00 UTC) #11
Evan Stade
lgtm
6 years, 8 months ago (2014-04-24 20:29:09 UTC) #12
msw
Elliot and Scott, please take a look; thanks!
6 years, 8 months ago (2014-04-24 20:36:19 UTC) #13
Elliot Glaysher
lgtm
6 years, 8 months ago (2014-04-24 21:08:56 UTC) #14
sky
https://codereview.chromium.org/239093007/diff/380001/chrome/browser/ui/views/frame/browser_view.cc File chrome/browser/ui/views/frame/browser_view.cc (right): https://codereview.chromium.org/239093007/diff/380001/chrome/browser/ui/views/frame/browser_view.cc#newcode1847 chrome/browser/ui/views/frame/browser_view.cc:1847: chrome::MaybeShowInvertBubbleView(this); estade's patch made it show that you'll hit ...
6 years, 8 months ago (2014-04-24 22:52:01 UTC) #15
msw
https://codereview.chromium.org/239093007/diff/380001/chrome/browser/ui/views/frame/browser_view.cc File chrome/browser/ui/views/frame/browser_view.cc (right): https://codereview.chromium.org/239093007/diff/380001/chrome/browser/ui/views/frame/browser_view.cc#newcode1847 chrome/browser/ui/views/frame/browser_view.cc:1847: chrome::MaybeShowInvertBubbleView(this); On 2014/04/24 22:52:01, sky wrote: > estade's patch ...
6 years, 8 months ago (2014-04-25 00:14:50 UTC) #16
msw
Yeah, Evan's r266047 broke this patch; give me a moment...
6 years, 8 months ago (2014-04-25 01:12:21 UTC) #17
msw
Okay please take a look at the latest patch set; thanks.
6 years, 8 months ago (2014-04-25 01:23:57 UTC) #18
sky
LGTM - I'm going to morph the bug you filed into a more general one. ...
6 years, 8 months ago (2014-04-25 15:32:07 UTC) #19
msw
https://codereview.chromium.org/239093007/diff/500001/chrome/browser/ui/views/frame/browser_view.cc File chrome/browser/ui/views/frame/browser_view.cc (right): https://codereview.chromium.org/239093007/diff/500001/chrome/browser/ui/views/frame/browser_view.cc#newcode1839 chrome/browser/ui/views/frame/browser_view.cc:1839: if (!initialized_) On 2014/04/25 15:32:08, sky wrote: > This ...
6 years, 8 months ago (2014-04-25 15:45:30 UTC) #20
msw
The CQ bit was checked by msw@chromium.org
6 years, 8 months ago (2014-04-25 15:45:44 UTC) #21
msw
The CQ bit was checked by msw@chromium.org
6 years, 8 months ago (2014-04-25 16:10:18 UTC) #22
msw
The CQ bit was unchecked by msw@chromium.org
6 years, 8 months ago (2014-04-25 16:24:38 UTC) #23
msw
The CQ bit was checked by msw@chromium.org
6 years, 8 months ago (2014-04-25 16:24:58 UTC) #24
msw
6 years, 8 months ago (2014-04-25 20:21:53 UTC) #25
Message was sent while issue was closed.
Committed patchset #16 manually as r266232 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698