OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/conflicts_ui.h" | 5 #include "chrome/browser/dom_ui/conflicts_ui.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 localized_strings.SetString("investigatingText", | 72 localized_strings.SetString("investigatingText", |
73 l10n_util::GetStringUTF16(IDS_CONFLICTS_CHECK_INVESTIGATING)); | 73 l10n_util::GetStringUTF16(IDS_CONFLICTS_CHECK_INVESTIGATING)); |
74 localized_strings.SetString("modulesNoneLoaded", | 74 localized_strings.SetString("modulesNoneLoaded", |
75 l10n_util::GetStringUTF16(IDS_CONFLICTS_NO_MODULES_LOADED)); | 75 l10n_util::GetStringUTF16(IDS_CONFLICTS_NO_MODULES_LOADED)); |
76 localized_strings.SetString("headerSoftware", | 76 localized_strings.SetString("headerSoftware", |
77 l10n_util::GetStringUTF16(IDS_CONFLICTS_HEADER_SOFTWARE)); | 77 l10n_util::GetStringUTF16(IDS_CONFLICTS_HEADER_SOFTWARE)); |
78 localized_strings.SetString("headerSignedBy", | 78 localized_strings.SetString("headerSignedBy", |
79 l10n_util::GetStringUTF16(IDS_CONFLICTS_HEADER_SIGNED_BY)); | 79 l10n_util::GetStringUTF16(IDS_CONFLICTS_HEADER_SIGNED_BY)); |
80 localized_strings.SetString("headerLocation", | 80 localized_strings.SetString("headerLocation", |
81 l10n_util::GetStringUTF16(IDS_CONFLICTS_HEADER_LOCATION)); | 81 l10n_util::GetStringUTF16(IDS_CONFLICTS_HEADER_LOCATION)); |
82 localized_strings.SetString("headerWarning", | 82 localized_strings.SetString("headerVersion", |
83 l10n_util::GetStringUTF16(IDS_CONFLICTS_HEADER_WARNING)); | 83 l10n_util::GetStringUTF16(IDS_CONFLICTS_HEADER_VERSION)); |
84 localized_strings.SetString("headerHelpTip", | 84 localized_strings.SetString("headerHelpTip", |
85 l10n_util::GetStringUTF16(IDS_CONFLICTS_HEADER_HELP_TIP)); | 85 l10n_util::GetStringUTF16(IDS_CONFLICTS_HEADER_HELP_TIP)); |
86 | 86 |
87 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); | 87 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); |
88 | 88 |
89 static const base::StringPiece flags_html( | 89 static const base::StringPiece flags_html( |
90 ResourceBundle::GetSharedInstance().GetRawDataResource( | 90 ResourceBundle::GetSharedInstance().GetRawDataResource( |
91 IDR_ABOUT_CONFLICTS_HTML)); | 91 IDR_ABOUT_CONFLICTS_HTML)); |
92 std::string full_html(flags_html.data(), flags_html.size()); | 92 std::string full_html(flags_html.data(), flags_html.size()); |
93 jstemplate_builder::AppendJsonHtml(&localized_strings, &full_html); | 93 jstemplate_builder::AppendJsonHtml(&localized_strings, &full_html); |
94 jstemplate_builder::AppendI18nTemplateSourceHtml(&full_html); | 94 jstemplate_builder::AppendI18nTemplateSourceHtml(&full_html); |
95 jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html); | 95 jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html); |
96 jstemplate_builder::AppendJsTemplateSourceHtml(&full_html); | 96 jstemplate_builder::AppendJsTemplateSourceHtml(&full_html); |
97 | 97 |
98 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); | 98 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); |
99 html_bytes->data.resize(full_html.size()); | 99 html_bytes->data.resize(full_html.size()); |
100 std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); | 100 std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); |
101 | 101 |
102 SendResponse(request_id, html_bytes); | 102 SendResponse(request_id, html_bytes); |
103 } | 103 } |
104 | 104 |
105 //////////////////////////////////////////////////////////////////////////////// | 105 //////////////////////////////////////////////////////////////////////////////// |
106 // | 106 // |
107 // ConflictsDOMHandler | 107 // ConflictsDOMHandler |
108 // | 108 // |
109 //////////////////////////////////////////////////////////////////////////////// | 109 //////////////////////////////////////////////////////////////////////////////// |
110 | 110 |
111 // The handler for Javascript messages for the about:flags page. | 111 // The handler for JavaScript messages for the about:flags page. |
112 class ConflictsDOMHandler : public DOMMessageHandler, | 112 class ConflictsDOMHandler : public DOMMessageHandler, |
113 public NotificationObserver { | 113 public NotificationObserver { |
114 public: | 114 public: |
115 ConflictsDOMHandler() {} | 115 ConflictsDOMHandler() {} |
116 virtual ~ConflictsDOMHandler() {} | 116 virtual ~ConflictsDOMHandler() {} |
117 | 117 |
118 // DOMMessageHandler implementation. | 118 // DOMMessageHandler implementation. |
119 virtual void RegisterMessages(); | 119 virtual void RegisterMessages(); |
120 | 120 |
121 // Callback for the "requestModuleList" message. | 121 // Callback for the "requestModuleList" message. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 make_scoped_refptr(html_source))); | 209 make_scoped_refptr(html_source))); |
210 } | 210 } |
211 | 211 |
212 // static | 212 // static |
213 RefCountedMemory* ConflictsUI::GetFaviconResourceBytes() { | 213 RefCountedMemory* ConflictsUI::GetFaviconResourceBytes() { |
214 return ResourceBundle::GetSharedInstance(). | 214 return ResourceBundle::GetSharedInstance(). |
215 LoadDataResourceBytes(IDR_CONFLICT_FAVICON); | 215 LoadDataResourceBytes(IDR_CONFLICT_FAVICON); |
216 } | 216 } |
217 | 217 |
218 #endif | 218 #endif |
OLD | NEW |