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

Side by Side Diff: chrome/browser/ui/webui/nacl_ui.cc

Issue 1332353003: Move resources for version_ui to //components/version_ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/nacl_ui.h" 5 #include "chrome/browser/ui/webui/nacl_ui.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 18 matching lines...) Expand all
29 #include "chrome/grit/generated_resources.h" 29 #include "chrome/grit/generated_resources.h"
30 #include "components/version_info/version_info.h" 30 #include "components/version_info/version_info.h"
31 #include "content/public/browser/browser_thread.h" 31 #include "content/public/browser/browser_thread.h"
32 #include "content/public/browser/plugin_service.h" 32 #include "content/public/browser/plugin_service.h"
33 #include "content/public/browser/user_metrics.h" 33 #include "content/public/browser/user_metrics.h"
34 #include "content/public/browser/web_ui.h" 34 #include "content/public/browser/web_ui.h"
35 #include "content/public/browser/web_ui_data_source.h" 35 #include "content/public/browser/web_ui_data_source.h"
36 #include "content/public/browser/web_ui_message_handler.h" 36 #include "content/public/browser/web_ui_message_handler.h"
37 #include "content/public/common/webplugininfo.h" 37 #include "content/public/common/webplugininfo.h"
38 #include "grit/browser_resources.h" 38 #include "grit/browser_resources.h"
39 #include "grit/components_strings.h"
39 #include "ui/base/l10n/l10n_util.h" 40 #include "ui/base/l10n/l10n_util.h"
40 41
41 #if defined(OS_WIN) 42 #if defined(OS_WIN)
42 #include "base/win/windows_version.h" 43 #include "base/win/windows_version.h"
43 #endif 44 #endif
44 45
45 using base::ASCIIToUTF16; 46 using base::ASCIIToUTF16;
46 using base::UserMetricsAction; 47 using base::UserMetricsAction;
47 using content::BrowserThread; 48 using content::BrowserThread;
48 using content::PluginService; 49 using content::PluginService;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 case base::win::VERSION_WIN7: os_label += " 7 or Server 2008 R2"; break; 198 case base::win::VERSION_WIN7: os_label += " 7 or Server 2008 R2"; break;
198 case base::win::VERSION_WIN8: os_label += " 8 or Server 2012"; break; 199 case base::win::VERSION_WIN8: os_label += " 8 or Server 2012"; break;
199 default: os_label += " UNKNOWN"; break; 200 default: os_label += " UNKNOWN"; break;
200 } 201 }
201 os_label += " SP" + base::IntToString(os->service_pack().major); 202 os_label += " SP" + base::IntToString(os->service_pack().major);
202 if (os->service_pack().minor > 0) 203 if (os->service_pack().minor > 0)
203 os_label += "." + base::IntToString(os->service_pack().minor); 204 os_label += "." + base::IntToString(os->service_pack().minor);
204 if (os->architecture() == base::win::OSInfo::X64_ARCHITECTURE) 205 if (os->architecture() == base::win::OSInfo::X64_ARCHITECTURE)
205 os_label += " 64 bit"; 206 os_label += " 64 bit";
206 #endif 207 #endif
207 AddPair(list, 208 AddPair(list, l10n_util::GetStringUTF16(IDS_VERSION_UI_OS),
208 l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_OS),
209 ASCIIToUTF16(os_label)); 209 ASCIIToUTF16(os_label));
210 AddLineBreak(list); 210 AddLineBreak(list);
211 } 211 }
212 212
213 void NaClDomHandler::AddPluginList(base::ListValue* list) { 213 void NaClDomHandler::AddPluginList(base::ListValue* list) {
214 // Obtain the version of the NaCl plugin. 214 // Obtain the version of the NaCl plugin.
215 std::vector<content::WebPluginInfo> info_array; 215 std::vector<content::WebPluginInfo> info_array;
216 PluginService::GetInstance()->GetPluginInfoArray( 216 PluginService::GetInstance()->GetPluginInfoArray(
217 GURL(), "application/x-nacl", false, &info_array, NULL); 217 GURL(), "application/x-nacl", false, &info_array, NULL);
218 base::string16 nacl_version; 218 base::string16 nacl_version;
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 381
382 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { 382 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) {
383 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); 383 content::RecordAction(UserMetricsAction("ViewAboutNaCl"));
384 384
385 web_ui->AddMessageHandler(new NaClDomHandler()); 385 web_ui->AddMessageHandler(new NaClDomHandler());
386 386
387 // Set up the about:nacl source. 387 // Set up the about:nacl source.
388 Profile* profile = Profile::FromWebUI(web_ui); 388 Profile* profile = Profile::FromWebUI(web_ui);
389 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); 389 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource());
390 } 390 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/help/help_handler.cc ('k') | chrome/browser/ui/webui/version_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698