| OLD | NEW |
| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/ui/webui/translate_internals/translate_internals_handle
r.h" | 15 #include "chrome/browser/ui/webui/translate_internals/translate_internals_handle
r.h" |
| 16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
| 18 #include "components/translate/content/common/cld_data_source.h" | 18 #include "components/translate/content/common/cld_data_source.h" |
| 19 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
| 20 #include "content/public/browser/web_ui.h" | 20 #include "content/public/browser/web_ui.h" |
| 21 #include "content/public/browser/web_ui_data_source.h" | 21 #include "content/public/browser/web_ui_data_source.h" |
| 22 #include "grit/browser_resources.h" | 22 #include "grit/browser_resources.h" |
| 23 #include "grit/translate_internals_resources.h" | 23 #include "grit/translate_internals_resources.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | |
| 26 | 25 |
| 27 namespace { | 26 namespace { |
| 28 | 27 |
| 29 // Sets the languages to |dict|. Each key is a language code and each value is | 28 // Sets the languages to |dict|. Each key is a language code and each value is |
| 30 // a language name in the locale. | 29 // a language name in the locale. |
| 31 void GetLanguages(base::DictionaryValue* dict) { | 30 void GetLanguages(base::DictionaryValue* dict) { |
| 32 DCHECK(dict); | 31 DCHECK(dict); |
| 33 | 32 |
| 34 const std::string app_locale = g_browser_process->GetApplicationLocale(); | 33 const std::string app_locale = g_browser_process->GetApplicationLocale(); |
| 35 std::vector<std::string> language_codes; | 34 std::vector<std::string> language_codes; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 83 |
| 85 } // namespace | 84 } // namespace |
| 86 | 85 |
| 87 TranslateInternalsUI::TranslateInternalsUI(content::WebUI* web_ui) | 86 TranslateInternalsUI::TranslateInternalsUI(content::WebUI* web_ui) |
| 88 : WebUIController(web_ui) { | 87 : WebUIController(web_ui) { |
| 89 web_ui->AddMessageHandler(new TranslateInternalsHandler); | 88 web_ui->AddMessageHandler(new TranslateInternalsHandler); |
| 90 | 89 |
| 91 Profile* profile = Profile::FromWebUI(web_ui); | 90 Profile* profile = Profile::FromWebUI(web_ui); |
| 92 content::WebUIDataSource::Add(profile, CreateTranslateInternalsHTMLSource()); | 91 content::WebUIDataSource::Add(profile, CreateTranslateInternalsHTMLSource()); |
| 93 } | 92 } |
| OLD | NEW |