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

Side by Side Diff: chrome/browser/ui/webui/translate_internals/translate_internals_ui.cc

Issue 1920853002: Drop support for Compact Language Detector v1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Preserve yfriedman@ comment in chrome/android/chrome_apk.gyp Created 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h" 5 #include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 GetLanguages(&langs); 55 GetLanguages(&langs);
56 for (base::DictionaryValue::Iterator it(langs); !it.IsAtEnd(); it.Advance()) { 56 for (base::DictionaryValue::Iterator it(langs); !it.IsAtEnd(); it.Advance()) {
57 std::string key = "language-" + it.key(); 57 std::string key = "language-" + it.key();
58 std::string value; 58 std::string value;
59 it.value().GetAsString(&value); 59 it.value().GetAsString(&value);
60 source->AddString(key, value); 60 source->AddString(key, value);
61 } 61 }
62 62
63 std::string cld_version = ""; 63 std::string cld_version = "";
64 std::string cld_data_source = ""; 64 std::string cld_data_source = "";
65 // The version strings are hardcoded here to avoid linking with the CLD 65 // The version string is hardcoded here to avoid linking with the CLD
66 // library, see http://crbug.com/297777. 66 // library, see http://crbug.com/297777.
67 #if CLD_VERSION==1
68 cld_version = "1.6";
69 cld_data_source = "static"; // CLD1.x does not support dynamic data loading
70 #elif CLD_VERSION==2
71 cld_version = "2"; 67 cld_version = "2";
72 cld_data_source = translate::CldDataSource::Get()->GetName(); 68 cld_data_source = translate::CldDataSource::Get()->GetName();
73 #else
74 NOTREACHED();
75 #endif
76 source->AddString("cld-version", cld_version); 69 source->AddString("cld-version", cld_version);
77 source->AddString("cld-data-source", cld_data_source); 70 source->AddString("cld-data-source", cld_data_source);
78 71
79 return source; 72 return source;
80 } 73 }
81 74
82 } // namespace 75 } // namespace
83 76
84 TranslateInternalsUI::TranslateInternalsUI(content::WebUI* web_ui) 77 TranslateInternalsUI::TranslateInternalsUI(content::WebUI* web_ui)
85 : WebUIController(web_ui) { 78 : WebUIController(web_ui) {
86 web_ui->AddMessageHandler(new TranslateInternalsHandler); 79 web_ui->AddMessageHandler(new TranslateInternalsHandler);
87 80
88 Profile* profile = Profile::FromWebUI(web_ui); 81 Profile* profile = Profile::FromWebUI(web_ui);
89 content::WebUIDataSource::Add(profile, CreateTranslateInternalsHTMLSource()); 82 content::WebUIDataSource::Add(profile, CreateTranslateInternalsHTMLSource());
90 } 83 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698