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

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

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.cc
diff --git a/chrome/browser/translate/translate_url_fetcher.cc b/components/translate/core/browser/translate_url_fetcher.cc
similarity index 86%
rename from chrome/browser/translate/translate_url_fetcher.cc
rename to components/translate/core/browser/translate_url_fetcher.cc
index ba3204668be7e42cb4752aa14b1a4c4b76bb53df..f66695e123ca50fb913c1d8a61ff3693efbae702 100644
--- a/chrome/browser/translate/translate_url_fetcher.cc
+++ b/components/translate/core/browser/translate_url_fetcher.cc
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/translate/translate_url_fetcher.h"
+#include "components/translate/core/browser/translate_url_fetcher.h"
-#include "chrome/browser/browser_process.h"
+#include "components/translate/core/browser/translate_delegate.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "net/url_request/url_fetcher.h"
@@ -17,8 +17,9 @@ const int kMaxRetry = 16;
} // namespace
-TranslateURLFetcher::TranslateURLFetcher(int id)
+TranslateURLFetcher::TranslateURLFetcher(int id, TranslateDelegate* delegate)
: id_(id),
+ translate_delegate_(delegate),
state_(IDLE),
retry_count_(0) {
}
@@ -51,7 +52,7 @@ bool TranslateURLFetcher::Request(
this));
fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES);
- fetcher_->SetRequestContext(g_browser_process->system_request_context());
+ fetcher_->SetRequestContext(translate_delegate_->GetURLRequestContext());
// Set retry parameter for HTTP status code 5xx. This doesn't work against
// 106 (net::ERR_INTERNET_DISCONNECTED) and so on.
// TranslateLanguageList handles network status, and implements retry.
« no previous file with comments | « components/translate/core/browser/translate_url_fetcher.h ('k') | tools/gn/secondary/components/translate/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698