OLD | NEW |
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/flash_ui.h" | 5 #include "chrome/browser/ui/webui/flash_ui.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/i18n/time_formatting.h" | 13 #include "base/i18n/time_formatting.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
19 #include "base/threading/thread_restrictions.h" | 19 #include "base/threading/thread_restrictions.h" |
20 #include "base/timer/timer.h" | 20 #include "base/timer/timer.h" |
21 #include "base/values.h" | 21 #include "base/values.h" |
22 #include "chrome/browser/crash_upload_list.h" | 22 #include "chrome/browser/crash_upload_list.h" |
23 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 23 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
24 #include "chrome/browser/plugins/plugin_prefs.h" | 24 #include "chrome/browser/plugins/plugin_prefs.h" |
25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
26 #include "chrome/common/chrome_version_info.h" | 26 #include "chrome/common/channel_info.h" |
27 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
28 #include "chrome/grit/chromium_strings.h" | 28 #include "chrome/grit/chromium_strings.h" |
29 #include "chrome/grit/generated_resources.h" | 29 #include "chrome/grit/generated_resources.h" |
| 30 #include "components/version_info/version_info.h" |
30 #include "content/public/browser/gpu_data_manager.h" | 31 #include "content/public/browser/gpu_data_manager.h" |
31 #include "content/public/browser/gpu_data_manager_observer.h" | 32 #include "content/public/browser/gpu_data_manager_observer.h" |
32 #include "content/public/browser/plugin_service.h" | 33 #include "content/public/browser/plugin_service.h" |
33 #include "content/public/browser/user_metrics.h" | 34 #include "content/public/browser/user_metrics.h" |
34 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
35 #include "content/public/browser/web_ui.h" | 36 #include "content/public/browser/web_ui.h" |
36 #include "content/public/browser/web_ui_data_source.h" | 37 #include "content/public/browser/web_ui_data_source.h" |
37 #include "content/public/browser/web_ui_message_handler.h" | 38 #include "content/public/browser/web_ui_message_handler.h" |
38 #include "content/public/common/content_constants.h" | 39 #include "content/public/common/content_constants.h" |
39 #include "content/public/common/webplugininfo.h" | 40 #include "content/public/common/webplugininfo.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 !has_plugin_info_) { | 227 !has_plugin_info_) { |
227 return; | 228 return; |
228 } | 229 } |
229 | 230 |
230 timeout_.Stop(); | 231 timeout_.Stop(); |
231 | 232 |
232 // This is code that runs only when the user types in about:flash. We don't | 233 // This is code that runs only when the user types in about:flash. We don't |
233 // need to jump through hoops to offload this to the IO thread. | 234 // need to jump through hoops to offload this to the IO thread. |
234 base::ThreadRestrictions::ScopedAllowIO allow_io; | 235 base::ThreadRestrictions::ScopedAllowIO allow_io; |
235 | 236 |
236 // Obtain the Chrome version info. | |
237 chrome::VersionInfo version_info; | |
238 | |
239 base::ListValue* list = new base::ListValue(); | 237 base::ListValue* list = new base::ListValue(); |
240 | 238 |
241 // Chrome version information. | 239 // Chrome version information. |
242 AddPair(list, | 240 AddPair(list, |
243 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 241 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
244 version_info.Version() + " (" + | 242 version_info::GetVersionNumber() + " (" + |
245 chrome::VersionInfo::GetVersionStringModifier() + ")"); | 243 chrome::GetChannelString() + ")"); |
246 | 244 |
247 // OS version information. | 245 // OS version information. |
248 std::string os_label = version_info.OSType(); | 246 std::string os_label = version_info::GetOSType(); |
249 #if defined(OS_WIN) | 247 #if defined(OS_WIN) |
250 base::win::OSInfo* os = base::win::OSInfo::GetInstance(); | 248 base::win::OSInfo* os = base::win::OSInfo::GetInstance(); |
251 switch (os->version()) { | 249 switch (os->version()) { |
252 case base::win::VERSION_XP: os_label += " XP"; break; | 250 case base::win::VERSION_XP: os_label += " XP"; break; |
253 case base::win::VERSION_SERVER_2003: | 251 case base::win::VERSION_SERVER_2003: |
254 os_label += " Server 2003 or XP Pro 64 bit"; | 252 os_label += " Server 2003 or XP Pro 64 bit"; |
255 break; | 253 break; |
256 case base::win::VERSION_VISTA: os_label += " Vista or Server 2008"; break; | 254 case base::win::VERSION_VISTA: os_label += " Vista or Server 2008"; break; |
257 case base::win::VERSION_WIN7: os_label += " 7 or Server 2008 R2"; break; | 255 case base::win::VERSION_WIN7: os_label += " 7 or Server 2008 R2"; break; |
258 case base::win::VERSION_WIN8: os_label += " 8 or Server 2012"; break; | 256 case base::win::VERSION_WIN8: os_label += " 8 or Server 2012"; break; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 Profile* profile = Profile::FromWebUI(web_ui); | 389 Profile* profile = Profile::FromWebUI(web_ui); |
392 content::WebUIDataSource::Add(profile, CreateFlashUIHTMLSource()); | 390 content::WebUIDataSource::Add(profile, CreateFlashUIHTMLSource()); |
393 } | 391 } |
394 | 392 |
395 // static | 393 // static |
396 base::RefCountedMemory* FlashUI::GetFaviconResourceBytes( | 394 base::RefCountedMemory* FlashUI::GetFaviconResourceBytes( |
397 ui::ScaleFactor scale_factor) { | 395 ui::ScaleFactor scale_factor) { |
398 // Use the default icon for now. | 396 // Use the default icon for now. |
399 return NULL; | 397 return NULL; |
400 } | 398 } |
OLD | NEW |