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

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

Issue 23708004: Translate: Remove --enable-translate-settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modify TranslateManagerBrowserTest.NeverTranslateLanguagePref Created 7 years, 3 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
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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 base::DictionaryValue langs; 55 base::DictionaryValue langs;
56 GetLanguages(&langs); 56 GetLanguages(&langs);
57 for (base::DictionaryValue::Iterator it(langs); !it.IsAtEnd(); it.Advance()) { 57 for (base::DictionaryValue::Iterator it(langs); !it.IsAtEnd(); it.Advance()) {
58 std::string key = "language-" + it.key(); 58 std::string key = "language-" + it.key();
59 std::string value; 59 std::string value;
60 it.value().GetAsString(&value); 60 it.value().GetAsString(&value);
61 source->AddString(key, value); 61 source->AddString(key, value);
62 } 62 }
63 63
64 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
65 bool enable_translate_settings =
66 command_line.HasSwitch(switches::kEnableTranslateSettings);
67 source->AddBoolean("enable-translate-settings", enable_translate_settings);
68
69 std::string cld_version = LanguageDetectionUtil::GetCLDVersion(); 64 std::string cld_version = LanguageDetectionUtil::GetCLDVersion();
70 source->AddString("cld-version", cld_version); 65 source->AddString("cld-version", cld_version);
71 66
72 return source; 67 return source;
73 } 68 }
74 69
75 } // namespace 70 } // namespace
76 71
77 TranslateInternalsUI::TranslateInternalsUI(content::WebUI* web_ui) 72 TranslateInternalsUI::TranslateInternalsUI(content::WebUI* web_ui)
78 : WebUIController(web_ui) { 73 : WebUIController(web_ui) {
79 web_ui->AddMessageHandler(new TranslateInternalsHandler); 74 web_ui->AddMessageHandler(new TranslateInternalsHandler);
80 75
81 Profile* profile = Profile::FromWebUI(web_ui); 76 Profile* profile = Profile::FromWebUI(web_ui);
82 content::WebUIDataSource::Add(profile, CreateTranslateInternalsHTMLSource()); 77 content::WebUIDataSource::Add(profile, CreateTranslateInternalsHTMLSource());
83 } 78 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698