Chromium Code Reviews| Index: ios/chrome/browser/translate/translate_service_ios.h |
| diff --git a/ios/chrome/browser/translate/translate_service_ios.h b/ios/chrome/browser/translate/translate_service_ios.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..143176ac694783205cb970c92d360da31fd68fcc |
| --- /dev/null |
| +++ b/ios/chrome/browser/translate/translate_service_ios.h |
| @@ -0,0 +1,37 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef IOS_CHROME_BROWSER_TRANSLATE_TRANSLATE_SERVICE_IOS_H_ |
| +#define IOS_CHROME_BROWSER_TRANSLATE_TRANSLATE_SERVICE_IOS_H_ |
| + |
| +#include "components/web_resource/resource_request_allowed_notifier.h" |
| + |
| +class GURL; |
| + |
| +// Singleton managing the resources required for Translate. |
| +class TranslateServiceIOS |
| + : public web_resource::ResourceRequestAllowedNotifier::Observer { |
| + public: |
| + // Must be called before the Translate feature can be used. |
| + static void Initialize(); |
| + |
| + // Must be called to shut down the Translate feature. |
| + static void Shutdown(); |
| + |
| + // Returns true if the URL can be translated. |
| + static bool IsTranslatableURL(const GURL& url); |
| + |
| + private: |
| + TranslateServiceIOS(); |
| + ~TranslateServiceIOS(); |
| + |
| + // ResourceRequestAllowedNotifier::Observer methods. |
| + void OnResourceRequestsAllowed() override; |
| + |
| + // Helper class to know if it's allowed to make network resource requests. |
| + web_resource::ResourceRequestAllowedNotifier |
| + resource_request_allowed_notifier_; |
| +}; |
|
Alexei Svitkine (slow)
2015/01/08 16:52:13
Nit: DISALLOW_COPY_AND_ASSIGN
|
| + |
| +#endif // IOS_CHROME_BROWSER_TRANSLATE_TRANSLATE_SERVICE_IOS_H_ |