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

Unified Diff: chrome/browser/translate/translate_tab_helper.cc

Issue 216923006: Add a component updater for the CLD2 data file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows file path literals, change android flags back to normal Created 6 years, 8 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
« no previous file with comments | « chrome/browser/component_updater/url_fetcher_downloader.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_tab_helper.cc
diff --git a/chrome/browser/translate/translate_tab_helper.cc b/chrome/browser/translate/translate_tab_helper.cc
index 3ad59429378f19409e39e95fcb96fdd6ff8f679f..9af958f7b6ceab7d2bbc68d2d7b953519b537c24 100644
--- a/chrome/browser/translate/translate_tab_helper.cc
+++ b/chrome/browser/translate/translate_tab_helper.cc
@@ -43,6 +43,10 @@
#include "content/public/browser/render_view_host.h"
#endif
+#if defined(CLD2_IS_COMPONENT)
+#include "chrome/browser/component_updater/cld_component_installer.h"
+#endif
+
namespace {
// The maximum number of attempts we'll do to see if the page has finshed
@@ -387,16 +391,20 @@ void TranslateTabHelper::HandleCLDDataRequest() {
}
base::FilePath path;
+#if defined(CLD2_IS_COMPONENT)
+ if (!component_updater::GetLatestCldDataFile(&path))
+ return;
+#else
if (!PathService::Get(chrome::DIR_USER_DATA, &path)) {
LOG(WARNING) << "Unable to locate user data directory";
return; // Chrome isn't properly installed.
}
-
// If the file exists, we can send an IPC-safe construct back to the
// renderer process immediately.
path = path.Append(chrome::kCLDDataFilename);
if (!base::PathExists(path))
return;
+#endif
// Attempt to open the file for reading.
scoped_ptr<base::File> file(
« no previous file with comments | « chrome/browser/component_updater/url_fetcher_downloader.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698