| 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 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_SERVICE_H_ |
| 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_SERVICE_H_ | 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_SERVICE_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/web_resource/resource_request_allowed_notifier.h" |
| 9 |
| 8 // Singleton managing the resources required for Translate. | 10 // Singleton managing the resources required for Translate. |
| 9 class TranslateService { | 11 class TranslateService : public ResourceRequestAllowedNotifier::Observer { |
| 10 public: | 12 public: |
| 11 | |
| 12 // Must be called before the Translate feature can be used. | 13 // Must be called before the Translate feature can be used. |
| 13 static void Initialize(); | 14 static void Initialize(); |
| 14 | 15 |
| 15 // Must be called to shut down the Translate feature. | 16 // Must be called to shut down the Translate feature. |
| 16 static void Shutdown(bool cleanup_pending_fetcher); | 17 static void Shutdown(bool cleanup_pending_fetcher); |
| 18 |
| 19 private: |
| 20 TranslateService(); |
| 21 ~TranslateService(); |
| 22 |
| 23 // ResourceRequestAllowedNotifier::Observer methods. |
| 24 virtual void OnResourceRequestsAllowed() OVERRIDE; |
| 25 |
| 26 // Helper class to know if it's allowed to make network resource requests. |
| 27 ResourceRequestAllowedNotifier resource_request_allowed_notifier_; |
| 17 }; | 28 }; |
| 18 | 29 |
| 19 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_SERVICE_H_ | 30 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_SERVICE_H_ |
| OLD | NEW |