| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/doodle/doodle_service_factory.h" | 5 #include "chrome/browser/doodle/doodle_service_factory.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "base/time/default_clock.h" | 11 #include "base/time/default_clock.h" |
| 12 #include "base/time/default_tick_clock.h" |
| 12 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
| 13 #include "chrome/browser/google/google_url_tracker_factory.h" | 14 #include "chrome/browser/google/google_url_tracker_factory.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 15 #include "components/doodle/doodle_fetcher.h" | 16 #include "components/doodle/doodle_fetcher.h" |
| 16 #include "components/doodle/doodle_fetcher_impl.h" | 17 #include "components/doodle/doodle_fetcher_impl.h" |
| 17 #include "components/doodle/doodle_service.h" | 18 #include "components/doodle/doodle_service.h" |
| 18 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 19 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 19 #include "components/prefs/pref_service.h" | 20 #include "components/prefs/pref_service.h" |
| 20 #include "components/safe_json/safe_json_parser.h" | 21 #include "components/safe_json/safe_json_parser.h" |
| 21 | 22 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 44 Profile* profile = static_cast<Profile*>(context); | 45 Profile* profile = static_cast<Profile*>(context); |
| 45 // We don't show doodles in incognito profiles (for now?). | 46 // We don't show doodles in incognito profiles (for now?). |
| 46 DCHECK(!profile->IsOffTheRecord()); | 47 DCHECK(!profile->IsOffTheRecord()); |
| 47 | 48 |
| 48 auto fetcher = base::MakeUnique<doodle::DoodleFetcherImpl>( | 49 auto fetcher = base::MakeUnique<doodle::DoodleFetcherImpl>( |
| 49 profile->GetRequestContext(), | 50 profile->GetRequestContext(), |
| 50 GoogleURLTrackerFactory::GetForProfile(profile), | 51 GoogleURLTrackerFactory::GetForProfile(profile), |
| 51 base::Bind(&safe_json::SafeJsonParser::Parse)); | 52 base::Bind(&safe_json::SafeJsonParser::Parse)); |
| 52 return new doodle::DoodleService(profile->GetPrefs(), std::move(fetcher), | 53 return new doodle::DoodleService(profile->GetPrefs(), std::move(fetcher), |
| 53 base::MakeUnique<base::OneShotTimer>(), | 54 base::MakeUnique<base::OneShotTimer>(), |
| 54 base::MakeUnique<base::DefaultClock>()); | 55 base::MakeUnique<base::DefaultClock>(), |
| 56 base::MakeUnique<base::DefaultTickClock>()); |
| 55 } | 57 } |
| OLD | NEW |