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/net_internals_ui.h" | 5 #include "chrome/browser/dom_ui/net_internals_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 CallJavascriptFunction(L"g_browser.receivedLogEventTypeConstants", dict); | 519 CallJavascriptFunction(L"g_browser.receivedLogEventTypeConstants", dict); |
520 } | 520 } |
521 | 521 |
522 // Tell the javascript about the version of the client and its | 522 // Tell the javascript about the version of the client and its |
523 // command line arguments. | 523 // command line arguments. |
524 { | 524 { |
525 DictionaryValue* dict = new DictionaryValue(); | 525 DictionaryValue* dict = new DictionaryValue(); |
526 | 526 |
527 chrome::VersionInfo version_info; | 527 chrome::VersionInfo version_info; |
528 | 528 |
529 if (!version_info.is_valid()) { | |
530 DLOG(ERROR) << "Unable to create chrome::VersionInfo"; | |
531 } else { | |
532 // We have everything we need to send the right values. | |
533 dict->SetString("version", version_info.Version()); | |
534 dict->SetString("cl", version_info.LastChange()); | |
535 dict->SetString("version_mod", | |
536 platform_util::GetVersionStringModifier()); | |
537 dict->SetString("official", | |
538 l10n_util::GetStringUTF16( | |
539 version_info.IsOfficialBuild() ? | |
540 IDS_ABOUT_VERSION_OFFICIAL | |
541 : IDS_ABOUT_VERSION_UNOFFICIAL)); | |
542 | 529 |
543 dict->SetString("command_line", | 530 // We have everything we need to send the right values. |
544 CommandLine::ForCurrentProcess()->command_line_string()); | 531 dict->SetString("version", version_info.Version()); |
545 } | 532 dict->SetString("cl", version_info.LastChange()); |
| 533 dict->SetString("version_mod", |
| 534 platform_util::GetVersionStringModifier()); |
| 535 dict->SetString("official", |
| 536 l10n_util::GetStringUTF16( |
| 537 version_info.IsOfficialBuild() ? |
| 538 IDS_ABOUT_VERSION_OFFICIAL |
| 539 : IDS_ABOUT_VERSION_UNOFFICIAL)); |
| 540 |
| 541 dict->SetString("command_line", |
| 542 CommandLine::ForCurrentProcess()->command_line_string()); |
| 543 |
546 | 544 |
547 CallJavascriptFunction(L"g_browser.receivedClientInfo", | 545 CallJavascriptFunction(L"g_browser.receivedClientInfo", |
548 dict); | 546 dict); |
549 } | 547 } |
550 | 548 |
551 // Tell the javascript about the relationship between load flag enums and | 549 // Tell the javascript about the relationship between load flag enums and |
552 // their symbolic name. | 550 // their symbolic name. |
553 { | 551 { |
554 DictionaryValue* dict = new DictionaryValue(); | 552 DictionaryValue* dict = new DictionaryValue(); |
555 | 553 |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); | 1022 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); |
1025 | 1023 |
1026 // Set up the chrome://net-internals/ source. | 1024 // Set up the chrome://net-internals/ source. |
1027 BrowserThread::PostTask( | 1025 BrowserThread::PostTask( |
1028 BrowserThread::IO, FROM_HERE, | 1026 BrowserThread::IO, FROM_HERE, |
1029 NewRunnableMethod( | 1027 NewRunnableMethod( |
1030 ChromeURLDataManager::GetInstance(), | 1028 ChromeURLDataManager::GetInstance(), |
1031 &ChromeURLDataManager::AddDataSource, | 1029 &ChromeURLDataManager::AddDataSource, |
1032 make_scoped_refptr(html_source))); | 1030 make_scoped_refptr(html_source))); |
1033 } | 1031 } |
OLD | NEW |