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

Issue 1310183009: Add ability for Widgets to override the DefaultThemeProvider (Closed)

Created:
5 years, 3 months ago by jonross
Modified:
5 years, 3 months ago
CC:
chromium-reviews, tfarina, tdanderson+views_chromium.org, dzhioev+watch_chromium.org, oshima+watch_chromium.org, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add ability for Widgets to override the DefaultThemeProvider Certain views access layout information from ThemeProvider::GetDisplayProperty() However some Widgets created for dialogs and popups do not provide a ThemeProvider. This impacts the re-use of these views. Update Widget to allow for a theme provider to be set as an override. Update CaptivePortalWindowTest to set the appropriate ThemeProvider so that LocationBarView can properly layout. Update OmniboxPopupContentsView to set the appropriate ThemeProvider so that it will be able to stop using LocationBarView as a way to get the appropriate theme. TEST=CaptivePortalWindowTest BUG=524204

Patch Set 1 #

Patch Set 2 : #

Total comments: 3

Patch Set 3 : #

Total comments: 2

Patch Set 4 : #

Total comments: 3

Patch Set 5 : Rebase #

Total comments: 6

Patch Set 6 : Only Set ThemeProvider on Top Level Widget #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -15 lines) Patch
M chrome/browser/chromeos/login/ui/lock_window_aura.cc View 1 2 3 4 5 2 chunks +11 lines, -0 lines 1 comment Download
M chrome/browser/chromeos/login/ui/login_display_host_impl.cc View 1 2 3 4 5 2 chunks +10 lines, -0 lines 1 comment Download
M chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc View 1 2 3 4 5 3 chunks +22 lines, -0 lines 1 comment Download
M ui/views/widget/widget.h View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M ui/views/widget/widget.cc View 1 2 3 4 5 5 chunks +12 lines, -15 lines 2 comments Download

Depends on Patchset:

Messages

Total messages: 28 (5 generated)
jonross
Hey Terry, Can you take a first look at this change? I plan to also ...
5 years, 3 months ago (2015-08-27 17:23:34 UTC) #2
tdanderson
Seems reasonable to me so far.
5 years, 3 months ago (2015-08-27 18:00:02 UTC) #3
jonross
5 years, 3 months ago (2015-08-28 14:29:47 UTC) #4
jonross
sadrul@chromium.org: Please review changes in Widget
5 years, 3 months ago (2015-08-28 14:31:29 UTC) #6
sadrul
https://codereview.chromium.org/1310183009/diff/20001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/1310183009/diff/20001/ui/views/widget/widget.cc#newcode764 ui/views/widget/widget.cc:764: theme_provider_ = theme_provider; If a Widget has a theme-provider, ...
5 years, 3 months ago (2015-08-31 17:51:07 UTC) #7
jonross
https://codereview.chromium.org/1310183009/diff/20001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/1310183009/diff/20001/ui/views/widget/widget.cc#newcode764 ui/views/widget/widget.cc:764: theme_provider_ = theme_provider; On 2015/08/31 17:51:07, sadrul wrote: > ...
5 years, 3 months ago (2015-09-01 13:44:30 UTC) #8
jonross
5 years, 3 months ago (2015-09-01 15:58:17 UTC) #9
sadrul
lgtm The line-wrapping in the CL description is a little weird right now. https://codereview.chromium.org/1310183009/diff/40001/ui/views/widget/widget.h File ...
5 years, 3 months ago (2015-09-02 17:21:58 UTC) #10
jonross
https://codereview.chromium.org/1310183009/diff/40001/ui/views/widget/widget.h File ui/views/widget/widget.h (right): https://codereview.chromium.org/1310183009/diff/40001/ui/views/widget/widget.h#newcode892 ui/views/widget/widget.h:892: // is provided. This is not owned by Widget. ...
5 years, 3 months ago (2015-09-02 18:35:40 UTC) #11
jonross
pkasting@chromium.org: Please review changes in chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc Thanks, Jon
5 years, 3 months ago (2015-09-02 18:35:57 UTC) #13
jonross
oshima@chromium.org: Please review changes in chrome/browser/chromeos/login/ui/captive_portal_window_proxy.cc Thanks, Jon
5 years, 3 months ago (2015-09-02 18:36:19 UTC) #15
oshima
https://codereview.chromium.org/1310183009/diff/60001/chrome/browser/chromeos/login/ui/captive_portal_window_proxy.cc File chrome/browser/chromeos/login/ui/captive_portal_window_proxy.cc (right): https://codereview.chromium.org/1310183009/diff/60001/chrome/browser/chromeos/login/ui/captive_portal_window_proxy.cc#newcode34 chrome/browser/chromeos/login/ui/captive_portal_window_proxy.cc:34: ProfileManager::GetActiveUserProfile()); You should get the profile associated with the ...
5 years, 3 months ago (2015-09-02 18:44:12 UTC) #16
Peter Kasting
What oshima said, plus another comment. https://codereview.chromium.org/1310183009/diff/80001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/1310183009/diff/80001/ui/views/widget/widget.cc#newcode753 ui/views/widget/widget.cc:753: return theme_provider_; It ...
5 years, 3 months ago (2015-09-02 21:44:15 UTC) #17
jonross
https://codereview.chromium.org/1310183009/diff/80001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/1310183009/diff/80001/ui/views/widget/widget.cc#newcode753 ui/views/widget/widget.cc:753: return theme_provider_; On 2015/09/02 21:44:14, Peter Kasting wrote: > ...
5 years, 3 months ago (2015-09-02 22:02:27 UTC) #18
Peter Kasting
On 2015/09/02 22:02:27, jonross wrote: > https://codereview.chromium.org/1310183009/diff/80001/ui/views/widget/widget.cc > File ui/views/widget/widget.cc (right): > > https://codereview.chromium.org/1310183009/diff/80001/ui/views/widget/widget.cc#newcode753 > ...
5 years, 3 months ago (2015-09-02 22:11:27 UTC) #19
sadrul
https://codereview.chromium.org/1310183009/diff/80001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/1310183009/diff/80001/ui/views/widget/widget.cc#newcode766 ui/views/widget/widget.cc:766: return default_theme_provider_.get(); Maybe this function should look like: if ...
5 years, 3 months ago (2015-09-02 22:17:50 UTC) #20
Peter Kasting
https://codereview.chromium.org/1310183009/diff/80001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/1310183009/diff/80001/ui/views/widget/widget.cc#newcode766 ui/views/widget/widget.cc:766: return default_theme_provider_.get(); On 2015/09/02 22:17:50, sadrul wrote: > Maybe ...
5 years, 3 months ago (2015-09-02 22:25:18 UTC) #21
jonross
I've updated the change to only set the ThemeProvider on the top level widget. Widget ...
5 years, 3 months ago (2015-09-09 14:54:36 UTC) #23
tdanderson
A couple of micro-nits, but this lgtm. https://codereview.chromium.org/1310183009/diff/120001/chrome/browser/chromeos/login/ui/lock_window_aura.cc File chrome/browser/chromeos/login/ui/lock_window_aura.cc (right): https://codereview.chromium.org/1310183009/diff/120001/chrome/browser/chromeos/login/ui/lock_window_aura.cc#newcode69 chrome/browser/chromeos/login/ui/lock_window_aura.cc:69: // profile. ...
5 years, 3 months ago (2015-09-09 17:38:59 UTC) #24
sadrul
https://codereview.chromium.org/1310183009/diff/120001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/1310183009/diff/120001/ui/views/widget/widget.cc#newcode361 ui/views/widget/widget.cc:361: default_theme_provider_.reset(new ui::DefaultThemeProvider); I was thinking this could be more ...
5 years, 3 months ago (2015-09-09 17:56:57 UTC) #25
Peter Kasting
It seems like this CL may be on hold pending moving around some ThemeProvider methods, ...
5 years, 3 months ago (2015-09-09 20:37:13 UTC) #26
oshima
captive_portal_window_proxy.cc is no longer in this CL. Is it intentional? https://codereview.chromium.org/1310183009/diff/120001/chrome/browser/chromeos/login/ui/login_display_host_impl.cc File chrome/browser/chromeos/login/ui/login_display_host_impl.cc (right): https://codereview.chromium.org/1310183009/diff/120001/chrome/browser/chromeos/login/ui/login_display_host_impl.cc#newcode1023 ...
5 years, 3 months ago (2015-09-10 00:20:38 UTC) #27
jonross
5 years, 3 months ago (2015-09-14 15:33:40 UTC) #28
On 2015/09/10 00:20:38, oshima wrote:
> captive_portal_window_proxy.cc is no longer in this CL. Is it intentional?
> 
>
https://codereview.chromium.org/1310183009/diff/120001/chrome/browser/chromeo...
> File chrome/browser/chromeos/login/ui/login_display_host_impl.cc (right):
> 
>
https://codereview.chromium.org/1310183009/diff/120001/chrome/browser/chromeo...
> chrome/browser/chromeos/login/ui/login_display_host_impl.cc:1023:
> ash::kShellWindowId_LockScreenContainer);
> this parent will never have associated profile. The screen is always locked by
> the 1st user, so i guess you have to use that?
> 
>
https://codereview.chromium.org/1310183009/diff/120001/chrome/browser/ui/view...
> File chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc (right):
> 
>
https://codereview.chromium.org/1310183009/diff/120001/chrome/browser/ui/view...
> chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc:258: // On
login
> screen and logged in as an anonymous user you might not get a
> Is it impossible to have omnibox in login screen, isn't it? 
> 
> Also, login screen is chromeos specific, so you should move that inside if
> defined cros.

This CL is on hold pending: https://codereview.chromium.org/1338103002/

It is likely that this specific CL will not be needed. However the changes in
Widget may become necessary pending work on theme coloration. If so I will
upload a new review.

I will close this review if the updates in 1338103002 allow for
https://codereview.chromium.org/1306173002/ to land without needing this theming
change.

Powered by Google App Engine
This is Rietveld 408576698