Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1689)

Unified Diff: ios/chrome/browser/translate/translate_service_ios.h

Issue 809333003: Upstream //ios/chrome/browser/translate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698