| 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/chromeos/app_mode/kiosk_diagnosis_runner.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_diagnosis_runner.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 namespace chromeos { | 22 namespace chromeos { |
| 23 | 23 |
| 24 class KioskDiagnosisRunner::Factory : public BrowserContextKeyedServiceFactory { | 24 class KioskDiagnosisRunner::Factory : public BrowserContextKeyedServiceFactory { |
| 25 public: | 25 public: |
| 26 static KioskDiagnosisRunner* GetForProfile(Profile* profile) { | 26 static KioskDiagnosisRunner* GetForProfile(Profile* profile) { |
| 27 return static_cast<KioskDiagnosisRunner*>( | 27 return static_cast<KioskDiagnosisRunner*>( |
| 28 GetInstance()->GetServiceForBrowserContext(profile, true)); | 28 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 29 } | 29 } |
| 30 | 30 |
| 31 static Factory* GetInstance() { | 31 static Factory* GetInstance() { return base::Singleton<Factory>::get(); } |
| 32 return Singleton<Factory>::get(); | |
| 33 } | |
| 34 | 32 |
| 35 private: | 33 private: |
| 36 friend struct DefaultSingletonTraits<Factory>; | 34 friend struct base::DefaultSingletonTraits<Factory>; |
| 37 | 35 |
| 38 Factory() | 36 Factory() |
| 39 : BrowserContextKeyedServiceFactory( | 37 : BrowserContextKeyedServiceFactory( |
| 40 "KioskDiagnosisRunner", | 38 "KioskDiagnosisRunner", |
| 41 BrowserContextDependencyManager::GetInstance()) { | 39 BrowserContextDependencyManager::GetInstance()) { |
| 42 DependsOn(extensions::ExtensionsBrowserClient::Get() | 40 DependsOn(extensions::ExtensionsBrowserClient::Get() |
| 43 ->GetExtensionSystemFactory()); | 41 ->GetExtensionSystemFactory()); |
| 44 DependsOn(extensions::FeedbackPrivateAPI::GetFactoryInstance()); | 42 DependsOn(extensions::FeedbackPrivateAPI::GetFactoryInstance()); |
| 45 } | 43 } |
| 46 | 44 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 feedback_data, | 118 feedback_data, |
| 121 base::Bind(&KioskDiagnosisRunner::OnFeedbackSent, | 119 base::Bind(&KioskDiagnosisRunner::OnFeedbackSent, |
| 122 weak_factory_.GetWeakPtr())); | 120 weak_factory_.GetWeakPtr())); |
| 123 } | 121 } |
| 124 | 122 |
| 125 void KioskDiagnosisRunner::OnFeedbackSent(bool) { | 123 void KioskDiagnosisRunner::OnFeedbackSent(bool) { |
| 126 // Do nothing. | 124 // Do nothing. |
| 127 } | 125 } |
| 128 | 126 |
| 129 } // namespace chromeos | 127 } // namespace chromeos |
| OLD | NEW |