| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_FACTORY_H_ | 6 #define CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // Returns true to show the opt in pop up for |context|. | 22 // Returns true to show the opt in pop up for |context|. |
| 23 static bool ShouldShowOptInPopup(content::BrowserContext* context); | 23 static bool ShouldShowOptInPopup(content::BrowserContext* context); |
| 24 | 24 |
| 25 // Returns true if the hotwording service is available for |context|. | 25 // Returns true if the hotwording service is available for |context|. |
| 26 static bool IsServiceAvailable(content::BrowserContext* context); | 26 static bool IsServiceAvailable(content::BrowserContext* context); |
| 27 | 27 |
| 28 // Returns true if hotwording is allowed for |context|. | 28 // Returns true if hotwording is allowed for |context|. |
| 29 static bool IsHotwordAllowed(content::BrowserContext* context); | 29 static bool IsHotwordAllowed(content::BrowserContext* context); |
| 30 | 30 |
| 31 // Passes control to the individual service to deal with reloading the | 31 // Returns the current error message for the service for |context|. |
| 32 // hotword extension as necessary. | 32 // A value of 0 indicates no error. |
| 33 static bool RetryHotwordExtension(Profile* profile); | 33 static int GetCurrentError(content::BrowserContext* context); |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 friend struct DefaultSingletonTraits<HotwordServiceFactory>; | 36 friend struct DefaultSingletonTraits<HotwordServiceFactory>; |
| 37 | 37 |
| 38 HotwordServiceFactory(); | 38 HotwordServiceFactory(); |
| 39 virtual ~HotwordServiceFactory(); | 39 virtual ~HotwordServiceFactory(); |
| 40 | 40 |
| 41 // Overrides from BrowserContextKeyedServiceFactory: | 41 // Overrides from BrowserContextKeyedServiceFactory: |
| 42 virtual void RegisterProfilePrefs( | 42 virtual void RegisterProfilePrefs( |
| 43 user_prefs::PrefRegistrySyncable* registry) OVERRIDE; | 43 user_prefs::PrefRegistrySyncable* registry) OVERRIDE; |
| 44 virtual KeyedService* BuildServiceInstanceFor( | 44 virtual KeyedService* BuildServiceInstanceFor( |
| 45 content::BrowserContext* context) const OVERRIDE; | 45 content::BrowserContext* context) const OVERRIDE; |
| 46 | 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(HotwordServiceFactory); | 47 DISALLOW_COPY_AND_ASSIGN(HotwordServiceFactory); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_FACTORY_H_ | 50 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_FACTORY_H_ |
| OLD | NEW |