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

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

Issue 145023015: Introduce TranslateService and TranslateDownloadManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittest 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/components/translate/core/browser/translate_url_fetcher.cc b/components/translate/core/browser/translate_url_fetcher.cc
index a02936941b0d892b05e07e849d96ce080d25720d..85988a9125e93559975b5fcf8d7bfbbb771e6daf 100644
--- a/components/translate/core/browser/translate_url_fetcher.cc
+++ b/components/translate/core/browser/translate_url_fetcher.cc
@@ -4,7 +4,7 @@
#include "components/translate/core/browser/translate_url_fetcher.h"
-#include "components/translate/core/browser/translate_delegate.h"
+#include "components/translate/core/browser/translate_download_manager.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "net/url_request/url_fetcher.h"
@@ -17,11 +17,9 @@ const int kMaxRetry = 16;
} // namespace
-TranslateURLFetcher::TranslateURLFetcher(int id, TranslateDelegate* delegate)
- : id_(id),
- translate_delegate_(delegate),
- state_(IDLE),
- retry_count_(0) {
+TranslateURLFetcher::TranslateURLFetcher(int id) : id_(id),
+ state_(IDLE),
+ retry_count_(0) {
}
TranslateURLFetcher::~TranslateURLFetcher() {
@@ -52,7 +50,8 @@ bool TranslateURLFetcher::Request(
this));
fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES);
- fetcher_->SetRequestContext(translate_delegate_->GetURLRequestContext());
+ fetcher_->SetRequestContext(
+ TranslateDownloadManager::GetInstance()->request_context());
// 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