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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 CallJavascriptFunction(L"g_browser.receivedLogEventTypeConstants", dict); | 530 CallJavascriptFunction(L"g_browser.receivedLogEventTypeConstants", dict); |
531 } | 531 } |
532 | 532 |
533 // Tell the javascript about the version of the client and its | 533 // Tell the javascript about the version of the client and its |
534 // command line arguments. | 534 // command line arguments. |
535 { | 535 { |
536 DictionaryValue* dict = new DictionaryValue(); | 536 DictionaryValue* dict = new DictionaryValue(); |
537 | 537 |
538 chrome::VersionInfo version_info; | 538 chrome::VersionInfo version_info; |
539 | 539 |
540 if (!version_info.is_valid()) { | |
541 DLOG(ERROR) << "Unable to create chrome::VersionInfo"; | |
542 } else { | |
543 // We have everything we need to send the right values. | |
544 dict->SetString("version", version_info.Version()); | |
545 dict->SetString("cl", version_info.LastChange()); | |
546 dict->SetString("version_mod", | |
547 platform_util::GetVersionStringModifier()); | |
548 dict->SetString("official", | |
549 l10n_util::GetStringUTF16( | |
550 version_info.IsOfficialBuild() ? | |
551 IDS_ABOUT_VERSION_OFFICIAL | |
552 : IDS_ABOUT_VERSION_UNOFFICIAL)); | |
553 | 540 |
554 dict->SetString("command_line", | 541 // We have everything we need to send the right values. |
555 CommandLine::ForCurrentProcess()->command_line_string()); | 542 dict->SetString("version", version_info.Version()); |
556 } | 543 dict->SetString("cl", version_info.LastChange()); |
| 544 dict->SetString("version_mod", |
| 545 platform_util::GetVersionStringModifier()); |
| 546 dict->SetString("official", |
| 547 l10n_util::GetStringUTF16( |
| 548 version_info.IsOfficialBuild() ? |
| 549 IDS_ABOUT_VERSION_OFFICIAL |
| 550 : IDS_ABOUT_VERSION_UNOFFICIAL)); |
| 551 |
| 552 dict->SetString("command_line", |
| 553 CommandLine::ForCurrentProcess()->command_line_string()); |
| 554 |
557 | 555 |
558 CallJavascriptFunction(L"g_browser.receivedClientInfo", | 556 CallJavascriptFunction(L"g_browser.receivedClientInfo", |
559 dict); | 557 dict); |
560 } | 558 } |
561 | 559 |
562 // Tell the javascript about the relationship between load flag enums and | 560 // Tell the javascript about the relationship between load flag enums and |
563 // their symbolic name. | 561 // their symbolic name. |
564 { | 562 { |
565 DictionaryValue* dict = new DictionaryValue(); | 563 DictionaryValue* dict = new DictionaryValue(); |
566 | 564 |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); | 1033 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); |
1036 | 1034 |
1037 // Set up the chrome://net-internals/ source. | 1035 // Set up the chrome://net-internals/ source. |
1038 BrowserThread::PostTask( | 1036 BrowserThread::PostTask( |
1039 BrowserThread::IO, FROM_HERE, | 1037 BrowserThread::IO, FROM_HERE, |
1040 NewRunnableMethod( | 1038 NewRunnableMethod( |
1041 ChromeURLDataManager::GetInstance(), | 1039 ChromeURLDataManager::GetInstance(), |
1042 &ChromeURLDataManager::AddDataSource, | 1040 &ChromeURLDataManager::AddDataSource, |
1043 make_scoped_refptr(html_source))); | 1041 make_scoped_refptr(html_source))); |
1044 } | 1042 } |
OLD | NEW |