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

Unified Diff: components/translate/core/browser/translate_url_fetcher.h

Issue 131463002: Move TranslateURLFetcher to the translate component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix translate.gypi for real Created 6 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: components/translate/core/browser/translate_url_fetcher.h
diff --git a/chrome/browser/translate/translate_url_fetcher.h b/components/translate/core/browser/translate_url_fetcher.h
similarity index 83%
rename from chrome/browser/translate/translate_url_fetcher.h
rename to components/translate/core/browser/translate_url_fetcher.h
index b7d89035dacaec99596bec4ef2f998bbcf777b46..0a85ae6c0284fbb2b9b43734f848eedfe960449b 100644
--- a/chrome/browser/translate/translate_url_fetcher.h
+++ b/components/translate/core/browser/translate_url_fetcher.h
@@ -2,14 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_URL_FETCHER_H_
-#define CHROME_BROWSER_TRANSLATE_TRANSLATE_URL_FETCHER_H_
+#ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_URL_FETCHER_H_
+#define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_URL_FETCHER_H_
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "url/gurl.h"
+class TranslateDelegate;
+
class TranslateURLFetcher : public net::URLFetcherDelegate {
public:
// Callback type for Request().
@@ -23,7 +25,8 @@ class TranslateURLFetcher : public net::URLFetcherDelegate {
FAILED, // The last fetch request was finished with a failure.
};
- explicit TranslateURLFetcher(int id);
+ // |delegate| is expected to outlive the TranslateURLFetcher.
+ explicit TranslateURLFetcher(int id, TranslateDelegate* delegate);
virtual ~TranslateURLFetcher();
int max_retry_on_5xx() {
@@ -59,6 +62,9 @@ class TranslateURLFetcher : public net::URLFetcherDelegate {
// ID which is assigned to the URLFetcher.
const int id_;
+ // Used to get information from the embedder of Translate.
+ TranslateDelegate* translate_delegate_;
+
// Internal state.
enum State state_;
@@ -81,4 +87,4 @@ class TranslateURLFetcher : public net::URLFetcherDelegate {
DISALLOW_COPY_AND_ASSIGN(TranslateURLFetcher);
};
-#endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_URL_FETCHER_H_
+#endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_URL_FETCHER_H_
« no previous file with comments | « components/translate/core/browser/translate_delegate.h ('k') | components/translate/core/browser/translate_url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698