• sdefresne's avatar
    Remove unnecessary overrides and test · 512e25f3
    sdefresne authored
    SuggestionsServiceFactory::GetForProfile() returns nullptr if
    Profile::IsOffTheRecord() is true. So when another factory or
    client code use the helper method to get the service, it gets
    a nullptr.
    
    The SuggestionsServiceFactory::GetBrowserContextToUse() test
    happens only in the GetServiceForBrowserContext() call, and
    thus does not happens when client code use this helper method.
    
    The only situation where GetBrowserContextToUse() could be
    called is if code directly call GetServiceForBrowserContext
    or if ServiceIsCreatedWithBrowserContext() were overridden
    to returns true.
    
    Since none of those two conditions are true, then the method
    is never called with an off-the-record Profile and the default
    implementation inherited from BrowserContextKeyedServiceFactory
    does the right thing (i.e. returns nullptr, which in turn cause
    GetServiceForBrowserContext to return nullptr).
    
    BUG=None
    
    Review URL: https://codereview.chromium.org/744033002
    
    Cr-Commit-Position: refs/heads/master@{#305059}
    512e25f3
suggestions_service_factory.h 1.38 KB