• Alex Ilin's avatar
    [Chrome colors] Move 3p NTP check to SearchTabHelper · 985b00b0
    Alex Ilin authored
    In order to reuse ChromeColorsService in non-NTP contexts, we need to
    move the 3p NTP check to the code that can be hit by 3p NTPs but not
    by non-NTP clients. SearchTabHelper handles requests from the local
    NTP renderer, so it's a natural fit.
    
    The observer for NTP-provider changes was actually redundant, so this
    CL removes it. Theme changes are reverted when the NTP navigates away
    without calling ConfirmThemeChanges. When the user changes the
    NTP-provider to third-party, all Google-NTP will be either:
    - closed which will trigger the theme revert (old NTP)
    - keep the same state so the user can continue modifying the theme
    (webUI NTP)
    
    Bug: 1128451
    Change-Id: I3a72ce9ffbaccca580b52e1b43f5b348e9bb9feb
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411944
    Commit-Queue: Alex Ilin <alexilin@chromium.org>
    Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#807954}
    985b00b0
search_tab_helper.cc 35.1 KB