| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/android/logo_service.h" | 5 #include "chrome/browser/android/logo_service.h" |
| 6 | 6 |
| 7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
| 8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
| 9 #include "chrome/browser/image_decoder.h" | 9 #include "chrome/browser/image_decoder.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // LogoServiceFactory --------------------------------------------------------- | 132 // LogoServiceFactory --------------------------------------------------------- |
| 133 | 133 |
| 134 // static | 134 // static |
| 135 LogoService* LogoServiceFactory::GetForProfile(Profile* profile) { | 135 LogoService* LogoServiceFactory::GetForProfile(Profile* profile) { |
| 136 return static_cast<LogoService*>( | 136 return static_cast<LogoService*>( |
| 137 GetInstance()->GetServiceForBrowserContext(profile, true)); | 137 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 138 } | 138 } |
| 139 | 139 |
| 140 // static | 140 // static |
| 141 LogoServiceFactory* LogoServiceFactory::GetInstance() { | 141 LogoServiceFactory* LogoServiceFactory::GetInstance() { |
| 142 return Singleton<LogoServiceFactory>::get(); | 142 return base::Singleton<LogoServiceFactory>::get(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 LogoServiceFactory::LogoServiceFactory() | 145 LogoServiceFactory::LogoServiceFactory() |
| 146 : BrowserContextKeyedServiceFactory( | 146 : BrowserContextKeyedServiceFactory( |
| 147 "LogoService", | 147 "LogoService", |
| 148 BrowserContextDependencyManager::GetInstance()) { | 148 BrowserContextDependencyManager::GetInstance()) { |
| 149 } | 149 } |
| 150 | 150 |
| 151 LogoServiceFactory::~LogoServiceFactory() {} | 151 LogoServiceFactory::~LogoServiceFactory() {} |
| 152 | 152 |
| 153 KeyedService* LogoServiceFactory::BuildServiceInstanceFor( | 153 KeyedService* LogoServiceFactory::BuildServiceInstanceFor( |
| 154 content::BrowserContext* context) const { | 154 content::BrowserContext* context) const { |
| 155 Profile* profile = static_cast<Profile*>(context); | 155 Profile* profile = static_cast<Profile*>(context); |
| 156 DCHECK(!profile->IsOffTheRecord()); | 156 DCHECK(!profile->IsOffTheRecord()); |
| 157 return new LogoService(profile); | 157 return new LogoService(profile); |
| 158 } | 158 } |
| OLD | NEW |