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" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 strings are 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 | 67 #if CLD_VERSION==1 |
68 cld_version = "1.6"; | 68 cld_version = "1.6"; |
69 cld_data_source = "static"; // CLD1.x does not support dynamic data loading | 69 cld_data_source = "static"; // CLD1.x does not support dynamic data loading |
70 #elif CLD_VERSION==2 | 70 #elif CLD_VERSION==2 |
71 cld_version = "2"; | 71 cld_version = "2"; |
72 cld_data_source = translate::CldDataSource::GetName(); | 72 cld_data_source = translate::CldDataSource::Get()->GetName(); |
73 #else | 73 #else |
74 NOTREACHED(); | 74 NOTREACHED(); |
75 #endif | 75 #endif |
76 source->AddString("cld-version", cld_version); | 76 source->AddString("cld-version", cld_version); |
77 source->AddString("cld-data-source", cld_data_source); | 77 source->AddString("cld-data-source", cld_data_source); |
78 | 78 |
79 return source; | 79 return source; |
80 } | 80 } |
81 | 81 |
82 } // namespace | 82 } // namespace |
83 | 83 |
84 TranslateInternalsUI::TranslateInternalsUI(content::WebUI* web_ui) | 84 TranslateInternalsUI::TranslateInternalsUI(content::WebUI* web_ui) |
85 : WebUIController(web_ui) { | 85 : WebUIController(web_ui) { |
86 web_ui->AddMessageHandler(new TranslateInternalsHandler); | 86 web_ui->AddMessageHandler(new TranslateInternalsHandler); |
87 | 87 |
88 Profile* profile = Profile::FromWebUI(web_ui); | 88 Profile* profile = Profile::FromWebUI(web_ui); |
89 content::WebUIDataSource::Add(profile, CreateTranslateInternalsHTMLSource()); | 89 content::WebUIDataSource::Add(profile, CreateTranslateInternalsHTMLSource()); |
90 } | 90 } |
OLD | NEW |