|
|
Chromium Code Reviews
DescriptionMakes MaterialDesignController initialization explicit
Also delays updating Material Design specific colors in GTK UI until after
about_flags::ConvertFlagsToSwitches() is called from
ChromeBrowserMainParts::PreCreateThreadsImpl().
Updates unit tests to avoid lazy initialization.
BUG=595108
Committed: https://crrev.com/147afe55fdc0f5b25d3b33090b2355ec67ce04b0
Cr-Commit-Position: refs/heads/master@{#386582}
Patch Set 1 #
Total comments: 5
Patch Set 2 : Added UpdatewithLocalState call to update colors after MD flag is added to the command line #
Total comments: 2
Patch Set 3 : Makes an explicit call to MaterialDesignController::Initialize() mandatory #Patch Set 4 : Adding MDC::Initialize() #Patch Set 5 : Fixes MaterialDesignControllerTest #Patch Set 6 : Fixes ash, aura and views unit tests #Patch Set 7 : Fixes more unit tests #Patch Set 8 : Fixes more unit tests (MessageCenterViewTest, ConstrainedWindowViewsTest) #Patch Set 9 : Attempt to fix a GN build #Patch Set 10 : Fixing BoundedLabelTest and MessageCenterViewTest #Patch Set 11 : Fixing ServiceProcessControlBrowserTest and MessageCenterViewTest #Patch Set 12 : Fixing an invalid DIR_USER_DATA flow #Patch Set 13 : Avoids a need to use AllowReinitialization #
Total comments: 4
Patch Set 14 : Adds TODOs to remove MD-related linux change once MD sticks #
Total comments: 4
Patch Set 15 : Renamed methods in Linux bits #
Total comments: 13
Patch Set 16 : comments #Messages
Total messages: 121 (56 generated)
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/1
varkha@chromium.org changed reviewers: + sky@chromium.org
sky@, notwithstanding the perils mentioned in the bug comment #7, does this make sense to you?
sky@chromium.org changed reviewers: + estade@chromium.org
No doubt this has subtle ramifications. I don't think I know what those might be. Adding +estade
Description was changed from ========== Delays LinuxUI initialization till PreCreateThreads Doing this avoids kicking MaterialDesignController::GetMode() before about_flags::ConvertFlagsToSwitches() is called from ChromeBrowserMainParts::PreCreateThreads() BUG=595108 ========== to ========== Delays LinuxUI initialization till PreCreateThreads Doing this avoids kicking MaterialDesignController::GetMode() before about_flags::ConvertFlagsToSwitches() is called from ChromeBrowserMainParts::PreCreateThreads() BUG=595108 ==========
sky@chromium.org changed reviewers: + thestig@chromium.org
+thestig know may know too
That gibberish didn't make sense. I meant '+thestig who may know too' On Thu, Mar 31, 2016 at 7:13 PM, <sky@chromium.org> wrote: > +thestig know may know too > > https://codereview.chromium.org/1845343005/ -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
It's a bit weird to move the call because: a) ToolkitInitialized() is for doing toolkit initialization. b) All the code that follows assume toolkit initialization has occurred. Though I have not spotted any code that requires toolkit init. Even with this CL, isn't ChromeMainDelegate::PreSandboxStartup() still going to call ui::MaterialDesignController::InitializeMode() before ChromeBrowserMainExtraPartsViewsLinux::PreCreateThreads() ?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_TIMED_OUT, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
I don't know what this breaks but I'm afraid it breaks something. https://codereview.chromium.org/1845343005/diff/1/chrome/browser/ui/views/chr... File chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc (right): https://codereview.chromium.org/1845343005/diff/1/chrome/browser/ui/views/chr... chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc:80: ChromeBrowserMainExtraPartsViews::ToolkitInitialized(); do you still need this? https://codereview.chromium.org/1845343005/diff/1/chrome/browser/ui/views/chr... chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc:84: views::LinuxUI::instance()->Initialize(); This seems wrong. According to documentation, this should be part of ToolkitInitialized. Also note this comment: https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/br...
On 2016/04/01 05:10:19, Lei Zhang wrote: > It's a bit weird to move the call because: > > a) ToolkitInitialized() is for doing toolkit initialization. Acq but not sure what alternative is there. > b) All the code that follows assume toolkit initialization has occurred. Though > I have not spotted any code that requires toolkit init. I haven't either in linux path. I have placed DCHECKs that confirm that LinuxUI::instance() is not invoked before ChromeBrowserMainExtraPartsViewsLinux::PreCreateThreads() so Initialize() is the first thing that happens to g_linux_ui instance. > Even with this CL, isn't ChromeMainDelegate::PreSandboxStartup() still going to > call ui::MaterialDesignController::InitializeMode() before > ChromeBrowserMainExtraPartsViewsLinux::PreCreateThreads() ? Yes, in zygote. Would this break anything though - MD-wise?
https://codereview.chromium.org/1845343005/diff/1/chrome/browser/ui/views/chr... File chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc (right): https://codereview.chromium.org/1845343005/diff/1/chrome/browser/ui/views/chr... chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc:80: ChromeBrowserMainExtraPartsViews::ToolkitInitialized(); On 2016/04/01 17:03:20, Evan Stade wrote: > do you still need this? No, it is a NOP. https://codereview.chromium.org/1845343005/diff/1/chrome/browser/ui/views/chr... chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc:84: views::LinuxUI::instance()->Initialize(); On 2016/04/01 17:03:20, Evan Stade wrote: > This seems wrong. According to documentation, this should be part of > ToolkitInitialized. Also note this comment: > > https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/br... Yes, this is probably a non-starter although I could not find what it really breaks (if anything) on Linux. Do you think it would be promising to see if we can isolate generation of colors_[ThemeProperties::COLOR_BACKGROUND_TAB_TEXT] in gtk2_ui.cc? That seems to be the only thing that needs to know MD mode so maybe we could leave the code as-is but add a call through that updates the colors to MD.
Patchset #2 (id:20001) has been deleted
I've uploaded a patch that no longer changes the order of initialization but still kicks MD controller later. PTAL. https://codereview.chromium.org/1845343005/diff/1/chrome/browser/ui/views/chr... File chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc (right): https://codereview.chromium.org/1845343005/diff/1/chrome/browser/ui/views/chr... chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc:84: views::LinuxUI::instance()->Initialize(); >> isolate generation of >> colors_[ThemeProperties::COLOR_BACKGROUND_TAB_TEXT] in gtk2_ui.cc? PTAL at the last patch set if you think that this could work.
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/40001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/1845343005/diff/40001/chrome/browser/ui/libgt... File chrome/browser/ui/libgtk2ui/gtk2_ui.cc (right): https://codereview.chromium.org/1845343005/diff/40001/chrome/browser/ui/libgt... chrome/browser/ui/libgtk2ui/gtk2_ui.cc:1371: LoadGtkValues(); wouldn't you have to UpdateColors here to? I'm not too fond of the name of UpdateColors (or UpdateWithLocalState). In general, this approach seems fragile because it's incredibly subtle that in some random parts of this file you can't call IsModeMaterial and some you can. I don't know if this bug is worth trying to fix because on linux it's really easy to pass a command line flag (which does work). I'd be in favor of just removing the about:flags entry on Linux since it's broken.
https://codereview.chromium.org/1845343005/diff/40001/chrome/browser/ui/libgt... File chrome/browser/ui/libgtk2ui/gtk2_ui.cc (right): https://codereview.chromium.org/1845343005/diff/40001/chrome/browser/ui/libgt... chrome/browser/ui/libgtk2ui/gtk2_ui.cc:1371: LoadGtkValues(); On 2016/04/01 23:24:18, Evan Stade wrote: > wouldn't you have to UpdateColors here to? Yes I would. > I'm not too fond of the name of UpdateColors (or UpdateWithLocalState). I didn't want to bring MD into the names and couldn't think of anything better. UpdateWithLocalState -> CommandLineReady ? Not sure if I like it any better though. > > In general, this approach seems fragile because it's incredibly subtle that in > some random parts of this file you can't call IsModeMaterial and some you can. I > don't know if this bug is worth trying to fix because on linux it's really easy > to pass a command line flag (which does work). I'd be in favor of just removing > the about:flags entry on Linux since it's broken. I think it is wrong to treat Linux any different as long as we support this platform. Also it is currently just as fragile on Windows, we just haven't broken it yet. I think a better approach would be to land this and then refactor MaterialDesignController to replace lazy initialization with explicit and assert on any GetMode being called before the explicit init. Then we won't be breaking it unknowingly. I think LoadChromeResources or some place up the stack would be right to init MD.
On 2016/04/01 23:55:40, varkha wrote: > https://codereview.chromium.org/1845343005/diff/40001/chrome/browser/ui/libgt... > File chrome/browser/ui/libgtk2ui/gtk2_ui.cc (right): > > https://codereview.chromium.org/1845343005/diff/40001/chrome/browser/ui/libgt... > chrome/browser/ui/libgtk2ui/gtk2_ui.cc:1371: LoadGtkValues(); > On 2016/04/01 23:24:18, Evan Stade wrote: > > wouldn't you have to UpdateColors here to? > > Yes I would. > > > > I'm not too fond of the name of UpdateColors (or UpdateWithLocalState). > > I didn't want to bring MD into the names and couldn't think of anything better. > UpdateWithLocalState -> CommandLineReady ? Not sure if I like it any better > though. > > > > > In general, this approach seems fragile because it's incredibly subtle that in > > some random parts of this file you can't call IsModeMaterial and some you can. > I > > don't know if this bug is worth trying to fix because on linux it's really > easy > > to pass a command line flag (which does work). I'd be in favor of just > removing > > the about:flags entry on Linux since it's broken. > > I think it is wrong to treat Linux any different as long as we support this > platform. The only reason about:flags was invented to begin with was because it's hard to pass CL flags on Windows and OSX. > Also it is currently just as fragile on Windows, we just haven't > broken it yet. > I think a better approach would be to land this and then refactor > MaterialDesignController to replace lazy initialization with explicit and assert > on any GetMode being called before the explicit init. Then we won't be breaking > it unknowingly. > I think LoadChromeResources or some place up the stack would be right to init > MD. sure, if you stick something like CHECK(!MDC::IsInitialized()); MDC::Initialize(); somewhere, that would go a ways towards addressing my fears.
To be clear, part of my ambivalence towards this bug is based on the fact that we are already defaulting to using MD on Linux, so the about:flags entry isn't there to enable a new feature for testing, it's there to disable a new feature, and it should go away pretty promptly one way or another.
On 2016/04/02 00:43:04, Evan Stade wrote: > On 2016/04/01 23:55:40, varkha wrote: > > > https://codereview.chromium.org/1845343005/diff/40001/chrome/browser/ui/libgt... > > File chrome/browser/ui/libgtk2ui/gtk2_ui.cc (right): > > > > > https://codereview.chromium.org/1845343005/diff/40001/chrome/browser/ui/libgt... > > chrome/browser/ui/libgtk2ui/gtk2_ui.cc:1371: LoadGtkValues(); > > On 2016/04/01 23:24:18, Evan Stade wrote: > > > wouldn't you have to UpdateColors here to? > > > > Yes I would. > > > > > > > I'm not too fond of the name of UpdateColors (or UpdateWithLocalState). > > > > I didn't want to bring MD into the names and couldn't think of anything > better. > > UpdateWithLocalState -> CommandLineReady ? Not sure if I like it any better > > though. > > > > > > > > In general, this approach seems fragile because it's incredibly subtle that > in > > > some random parts of this file you can't call IsModeMaterial and some you > can. > > I > > > don't know if this bug is worth trying to fix because on linux it's really > > easy > > > to pass a command line flag (which does work). I'd be in favor of just > > removing > > > the about:flags entry on Linux since it's broken. > > > > I think it is wrong to treat Linux any different as long as we support this > > platform. > > The only reason about:flags was invented to begin with was because it's hard to > pass CL flags on Windows and OSX. > > > Also it is currently just as fragile on Windows, we just haven't > > broken it yet. > > I think a better approach would be to land this and then refactor > > MaterialDesignController to replace lazy initialization with explicit and > assert > > on any GetMode being called before the explicit init. Then we won't be > breaking > > it unknowingly. > > I think LoadChromeResources or some place up the stack would be right to init > > MD. > > sure, if you stick something like > > CHECK(!MDC::IsInitialized()); > MDC::Initialize(); > > somewhere, that would go a ways towards addressing my fears. I'll do that and since I agree this is not critical I'll do it in this CL. I'm more worried about how the initialization path is obscure and subtly different on different platforms so making it explicit seems like a win.
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/60001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...)
Patchset #4 (id:80001) has been deleted
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/100001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Patchset #5 (id:120001) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/140001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...)
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/160001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/180001
Patchset #6 (id:160001) has been deleted
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/200001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...)
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/220001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios_dbg_simulator_gn on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator...) mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_r...)
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/240001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/260001
Description was changed from ========== Delays LinuxUI initialization till PreCreateThreads Doing this avoids kicking MaterialDesignController::GetMode() before about_flags::ConvertFlagsToSwitches() is called from ChromeBrowserMainParts::PreCreateThreads() BUG=595108 ========== to ========== Makes MaterialDesignController initialization explicit Also delays updating Material Design specific colors in GTK UI until after about_flags::ConvertFlagsToSwitches() is called from ChromeBrowserMainParts::PreCreateThreadsImpl() BUG=595108 ==========
Description was changed from ========== Makes MaterialDesignController initialization explicit Also delays updating Material Design specific colors in GTK UI until after about_flags::ConvertFlagsToSwitches() is called from ChromeBrowserMainParts::PreCreateThreadsImpl() BUG=595108 ========== to ========== Makes MaterialDesignController initialization explicit Also delays updating Material Design specific colors in GTK UI until after about_flags::ConvertFlagsToSwitches() is called from ChromeBrowserMainParts::PreCreateThreadsImpl(). Updates unit tests to avoid lazy initialization. BUG=595108 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/280001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/300001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...)
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/320001
Patchset #12 (id:300001) has been deleted
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Patchset #13 (id:340001) has been deleted
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/360001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/360001
Patchset #14 (id:380001) has been deleted
Patchset #13 (id:360001) has been deleted
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/400001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/400001
https://codereview.chromium.org/1845343005/diff/400001/ui/base/material_desig... File ui/base/material_design/material_design_controller.cc (right): https://codereview.chromium.org/1845343005/diff/400001/ui/base/material_desig... ui/base/material_design/material_design_controller.cc:36: CHECK(!is_mode_initialized_); estade@, can you please take another look? I have reworked this CL to avoid lazy initialization of the MDC and it should have CHECKs in place to enforce it. I think this is less brittle than what we had before where we already had to work around obscure initialization sequence on Mac. Of course it also fixes the original linux bug.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
I still question whether it's worth the changes to Linux. It's more or less a non-goal to support the about:flags entry in Linux in M51. https://codereview.chromium.org/1845343005/diff/400001/chrome/browser/ui/libg... File chrome/browser/ui/libgtk2ui/gtk2_ui.h (right): https://codereview.chromium.org/1845343005/diff/400001/chrome/browser/ui/libg... chrome/browser/ui/libgtk2ui/gtk2_ui.h:135: void UpdateColors(); can you mark all the changes that should be reverted when material design is default as such? Some of these are not obvious. (The obvious ones like MaterialDesignController::InitializeMode() don't need explicit docs)
I think the cost of supporting it is quite minimal and if it helps with being more strict about initialization sequence it is for the better. https://codereview.chromium.org/1845343005/diff/400001/chrome/browser/ui/libg... File chrome/browser/ui/libgtk2ui/gtk2_ui.h (right): https://codereview.chromium.org/1845343005/diff/400001/chrome/browser/ui/libg... chrome/browser/ui/libgtk2ui/gtk2_ui.h:135: void UpdateColors(); On 2016/04/06 21:43:44, Evan Stade wrote: > can you mark all the changes that should be reverted when material design is > default as such? Some of these are not obvious. (The obvious ones like > MaterialDesignController::InitializeMode() don't need explicit docs) Will do. MDC::Initialize might not go away, at least initially because it caches hybrid mode.
PTAL. https://codereview.chromium.org/1845343005/diff/400001/chrome/browser/ui/libg... File chrome/browser/ui/libgtk2ui/gtk2_ui.h (right): https://codereview.chromium.org/1845343005/diff/400001/chrome/browser/ui/libg... chrome/browser/ui/libgtk2ui/gtk2_ui.h:135: void UpdateColors(); On 2016/04/06 21:43:44, Evan Stade wrote: > can you mark all the changes that should be reverted when material design is > default as such? Some of these are not obvious. (The obvious ones like > MaterialDesignController::InitializeMode() don't need explicit docs) Done.
linux parts LGTM with nits. I looked at the test changes but I don't feel qualified to approve or disapprove. https://codereview.chromium.org/1845343005/diff/420001/chrome/browser/ui/libg... File chrome/browser/ui/libgtk2ui/gtk2_ui.h (right): https://codereview.chromium.org/1845343005/diff/420001/chrome/browser/ui/libg... chrome/browser/ui/libgtk2ui/gtk2_ui.h:139: void UpdateColors(); s/UpdateColors/UpdateMaterialDesignColors/ https://codereview.chromium.org/1845343005/diff/420001/ui/views/linux_ui/linu... File ui/views/linux_ui/linux_ui.h (right): https://codereview.chromium.org/1845343005/diff/420001/ui/views/linux_ui/linu... ui/views/linux_ui/linux_ui.h:85: virtual void UpdateWithLocalState() = 0; perhaps then this should be called MaterialDesignControllerReady or something?
varkha@chromium.org changed reviewers: + mkwst@chromium.org
mkwst@ for OWNERS in content/shell/browser/shell_browser_main_parts.cc. sky@ for OWNERS elsewhere. Thanks! https://codereview.chromium.org/1845343005/diff/420001/chrome/browser/ui/libg... File chrome/browser/ui/libgtk2ui/gtk2_ui.h (right): https://codereview.chromium.org/1845343005/diff/420001/chrome/browser/ui/libg... chrome/browser/ui/libgtk2ui/gtk2_ui.h:139: void UpdateColors(); On 2016/04/08 21:14:11, Evan Stade wrote: > s/UpdateColors/UpdateMaterialDesignColors/ Done. https://codereview.chromium.org/1845343005/diff/420001/ui/views/linux_ui/linu... File ui/views/linux_ui/linux_ui.h (right): https://codereview.chromium.org/1845343005/diff/420001/ui/views/linux_ui/linu... ui/views/linux_ui/linux_ui.h:85: virtual void UpdateWithLocalState() = 0; On 2016/04/08 21:14:11, Evan Stade wrote: > perhaps then this should be called MaterialDesignControllerReady or something? Done.
The CQ bit was checked by varkha@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/440001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/440001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
content/shell LGTM
https://codereview.chromium.org/1845343005/diff/440001/chrome/browser/ui/star... File chrome/browser/ui/startup/bad_flags_prompt.cc (right): https://codereview.chromium.org/1845343005/diff/440001/chrome/browser/ui/star... chrome/browser/ui/startup/bad_flags_prompt.cc:137: locale, NULL, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); Why do you need this change? https://codereview.chromium.org/1845343005/diff/440001/chrome/service/service... File chrome/service/service_process.cc (right): https://codereview.chromium.org/1845343005/diff/440001/chrome/service/service... chrome/service/service_process.cc:184: ui::MaterialDesignController::Initialize(); Why does the service process need material design? https://codereview.chromium.org/1845343005/diff/440001/content/public/test/br... File content/public/test/browser_test_base.cc (right): https://codereview.chromium.org/1845343005/diff/440001/content/public/test/br... content/public/test/browser_test_base.cc:186: ui::test::MaterialDesignControllerTestAPI::UninitializeMode(); Is it possible to supply a flag to ContentTestSuiteBase so you don't need the uninitialize here? https://codereview.chromium.org/1845343005/diff/440001/content/public/test/te... File content/public/test/test_renderer_host.cc (right): https://codereview.chromium.org/1845343005/diff/440001/content/public/test/te... content/public/test/test_renderer_host.cc:184: // ContentTestSuiteBase might have already initialized Similar comment here. https://codereview.chromium.org/1845343005/diff/440001/ui/aura/test/aura_test... File ui/aura/test/aura_test_base.cc (right): https://codereview.chromium.org/1845343005/diff/440001/ui/aura/test/aura_test... ui/aura/test/aura_test_base.cc:37: // ContentTestSuiteBase might have already initialized And here. https://codereview.chromium.org/1845343005/diff/440001/ui/base/material_desig... File ui/base/material_design/material_design_controller_unittest.cc (right): https://codereview.chromium.org/1845343005/diff/440001/ui/base/material_desig... ui/base/material_design/material_design_controller_unittest.cc:63: }; private: DISALLOW... for these. https://codereview.chromium.org/1845343005/diff/440001/ui/base/material_desig... ui/base/material_design/material_design_controller_unittest.cc:76: SetCommandLineSwitch(""); "" -> std::string() https://codereview.chromium.org/1845343005/diff/440001/ui/views/test/views_te... File ui/views/test/views_test_base.cc (right): https://codereview.chromium.org/1845343005/diff/440001/ui/views/test/views_te... ui/views/test/views_test_base.cc:30: // ContentTestSuiteBase might have already initialized and here
sky@, See an explanation of sorts. Maybe I misunderstood what you meant with "supply a flag to ContentTestSuiteBase". https://codereview.chromium.org/1845343005/diff/440001/chrome/browser/ui/star... File chrome/browser/ui/startup/bad_flags_prompt.cc (right): https://codereview.chromium.org/1845343005/diff/440001/chrome/browser/ui/star... chrome/browser/ui/startup/bad_flags_prompt.cc:137: locale, NULL, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); On 2016/04/11 15:32:40, sky wrote: > Why do you need this change? We only load resources here to get the 2 strings and then cleanup immediately in line 147 below. LOAD_COMMON_RESOURCES would load other resources as well and would need to have MDC initialized before that (and with this CL that would assert). MaybeShowInvalidUserDataDirWarningDialog is invoked before the local state is loaded so MDC would not yet be initialized. An alternative would be to init and uninit MDC here but since that would be the only place in our code base (other than tests) to require MDC::Uninitialize I prefer to just cdo this change here. https://codereview.chromium.org/1845343005/diff/440001/chrome/service/service... File chrome/service/service_process.cc (right): https://codereview.chromium.org/1845343005/diff/440001/chrome/service/service... chrome/service/service_process.cc:184: ui::MaterialDesignController::Initialize(); On 2016/04/11 15:32:40, sky wrote: > Why does the service process need material design? InitSharedInstanceWithLocale below (inside ResourceBundle::LoadChromeResources) checks MDC::Mode to load the right resource data pack. https://codereview.chromium.org/1845343005/diff/440001/content/public/test/br... File content/public/test/browser_test_base.cc (right): https://codereview.chromium.org/1845343005/diff/440001/content/public/test/br... content/public/test/browser_test_base.cc:186: ui::test::MaterialDesignControllerTestAPI::UninitializeMode(); On 2016/04/11 15:32:40, sky wrote: > Is it possible to supply a flag to ContentTestSuiteBase so you don't need the > uninitialize here? Not sure how this would be possible. The call stack I am dealing here is doing something like this: base::TestSuite::Run { (first calls:) -> TestSuite::Initialize() -> MDC::Initialize() (and then, still in TestSuite::Run()) -> testing::UnitTest::Run() -> UnitTestImpl::RunAllTests() -> ... (browser tests init) -> content::BrowserTestBase::SetUp() -> ... (BrowserMain initalization) -> ChromeBrowserMainParts::PreCreateThreadsImpl() -> MDC::Initialize() That second call to MDC::Init we need in a production browser code. The first call is in ContentTestSuiteBase and is necessary to make a lot of tests happy that need to load resource packs first. More tests have something similar - they load resource packs (and so we need to kick MDC) and then proceed to use something like a child of ViewsTestBase or AuraTestBase (which can also be run on their own in aura_unittests or views_unittests and so need their own MDC::Init call). I was trying to come up with the fewest number of (necessary and temporary evil) calls to MaterialDesignControllerTestAPI::UninitializeMode() that would still get all the bots happy. https://codereview.chromium.org/1845343005/diff/440001/ui/base/material_desig... File ui/base/material_design/material_design_controller_unittest.cc (right): https://codereview.chromium.org/1845343005/diff/440001/ui/base/material_desig... ui/base/material_design/material_design_controller_unittest.cc:63: }; On 2016/04/11 15:32:41, sky wrote: > private: DISALLOW... for these. Done. https://codereview.chromium.org/1845343005/diff/440001/ui/base/material_desig... ui/base/material_design/material_design_controller_unittest.cc:76: SetCommandLineSwitch(""); On 2016/04/11 15:32:41, sky wrote: > "" -> std::string() Done.
Ok, LGTM
The CQ bit was checked by varkha@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from estade@chromium.org, mkwst@chromium.org Link to the patchset: https://codereview.chromium.org/1845343005/#ps460001 (title: "comments")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/460001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/460001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by varkha@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1845343005/460001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1845343005/460001
Message was sent while issue was closed.
Description was changed from ========== Makes MaterialDesignController initialization explicit Also delays updating Material Design specific colors in GTK UI until after about_flags::ConvertFlagsToSwitches() is called from ChromeBrowserMainParts::PreCreateThreadsImpl(). Updates unit tests to avoid lazy initialization. BUG=595108 ========== to ========== Makes MaterialDesignController initialization explicit Also delays updating Material Design specific colors in GTK UI until after about_flags::ConvertFlagsToSwitches() is called from ChromeBrowserMainParts::PreCreateThreadsImpl(). Updates unit tests to avoid lazy initialization. BUG=595108 ==========
Message was sent while issue was closed.
Committed patchset #16 (id:460001)
Message was sent while issue was closed.
Description was changed from ========== Makes MaterialDesignController initialization explicit Also delays updating Material Design specific colors in GTK UI until after about_flags::ConvertFlagsToSwitches() is called from ChromeBrowserMainParts::PreCreateThreadsImpl(). Updates unit tests to avoid lazy initialization. BUG=595108 ========== to ========== Makes MaterialDesignController initialization explicit Also delays updating Material Design specific colors in GTK UI until after about_flags::ConvertFlagsToSwitches() is called from ChromeBrowserMainParts::PreCreateThreadsImpl(). Updates unit tests to avoid lazy initialization. BUG=595108 Committed: https://crrev.com/147afe55fdc0f5b25d3b33090b2355ec67ce04b0 Cr-Commit-Position: refs/heads/master@{#386582} ==========
Message was sent while issue was closed.
Patchset 16 (id:??) landed as https://crrev.com/147afe55fdc0f5b25d3b33090b2355ec67ce04b0 Cr-Commit-Position: refs/heads/master@{#386582}
Message was sent while issue was closed.
A revert of this CL (patchset #16 id:460001) has been created in https://codereview.chromium.org/1878943002/ by kjellander@chromium.org. The reason for reverting is: Breaks message_center_unittests on Linux Chromium OS ASan LSan Tests (1): NotifierSettingsViewTest.TestLearnMoreButton (run #1): [ RUN ] NotifierSettingsViewTest.TestLearnMoreButton [7310:7310:0411/222127:19091916288:FATAL:material_design_controller.cc(63)] Check failed: is_mode_initialized_. #0 0x000000481ae1 __interceptor_backtrace #1 0x0000006d28c3 base::debug::StackTrace::StackTrace() #2 0x00000063f5ca logging::LogMessage::~LogMessage() #3 0x0000008051c0 ui::MaterialDesignController::IsModeMaterial() #4 0x000001e62411 ui::GetAuraColor() The FindIt analysis seems correct: https://findit-for-me.appspot.com/build-failure?url=https://build.chromium.or... . |
