| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_about_handler.h" | 5 #include "chrome/browser/browser_about_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" |
| 12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 13 #include "base/file_util.h" | 14 #include "base/file_util.h" |
| 14 #include "base/i18n/number_formatting.h" | 15 #include "base/i18n/number_formatting.h" |
| 15 #include "base/json/json_writer.h" | 16 #include "base/json/json_writer.h" |
| 16 #include "base/memory/singleton.h" | 17 #include "base/memory/singleton.h" |
| 17 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
| 18 #include "base/metrics/stats_table.h" | 19 #include "base/metrics/stats_table.h" |
| 19 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 20 #include "base/string_number_conversions.h" | 21 #include "base/string_number_conversions.h" |
| 21 #include "base/string_piece.h" | 22 #include "base/string_piece.h" |
| (...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 | 1359 |
| 1359 #if defined(OS_CHROMEOS) | 1360 #if defined(OS_CHROMEOS) |
| 1360 // ChromeOSAboutVersionHandler ----------------------------------------------- | 1361 // ChromeOSAboutVersionHandler ----------------------------------------------- |
| 1361 | 1362 |
| 1362 ChromeOSAboutVersionHandler::ChromeOSAboutVersionHandler( | 1363 ChromeOSAboutVersionHandler::ChromeOSAboutVersionHandler( |
| 1363 AboutSource* source, | 1364 AboutSource* source, |
| 1364 int request_id) | 1365 int request_id) |
| 1365 : source_(source), | 1366 : source_(source), |
| 1366 request_id_(request_id) { | 1367 request_id_(request_id) { |
| 1367 loader_.GetVersion(&consumer_, | 1368 loader_.GetVersion(&consumer_, |
| 1368 NewCallback(this, &ChromeOSAboutVersionHandler::OnVersion), | 1369 base::Bind(&ChromeOSAboutVersionHandler::OnVersion, |
| 1370 base::Unretained(this)), |
| 1369 chromeos::VersionLoader::VERSION_FULL); | 1371 chromeos::VersionLoader::VERSION_FULL); |
| 1370 } | 1372 } |
| 1371 | 1373 |
| 1372 void ChromeOSAboutVersionHandler::OnVersion( | 1374 void ChromeOSAboutVersionHandler::OnVersion( |
| 1373 chromeos::VersionLoader::Handle handle, | 1375 chromeos::VersionLoader::Handle handle, |
| 1374 std::string version) { | 1376 std::string version) { |
| 1375 DictionaryValue localized_strings; | 1377 DictionaryValue localized_strings; |
| 1376 localized_strings.SetString("os_version", version); | 1378 localized_strings.SetString("os_version", version); |
| 1377 source_->FinishDataRequest(AboutVersionStrings( | 1379 source_->FinishDataRequest(AboutVersionStrings( |
| 1378 &localized_strings, source_->profile()), request_id_); | 1380 &localized_strings, source_->profile()), request_id_); |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1606 return false; | 1608 return false; |
| 1607 } | 1609 } |
| 1608 | 1610 |
| 1609 std::vector<std::string> ChromePaths() { | 1611 std::vector<std::string> ChromePaths() { |
| 1610 std::vector<std::string> paths; | 1612 std::vector<std::string> paths; |
| 1611 paths.reserve(arraysize(kChromePaths)); | 1613 paths.reserve(arraysize(kChromePaths)); |
| 1612 for (size_t i = 0; i < arraysize(kChromePaths); i++) | 1614 for (size_t i = 0; i < arraysize(kChromePaths); i++) |
| 1613 paths.push_back(kChromePaths[i]); | 1615 paths.push_back(kChromePaths[i]); |
| 1614 return paths; | 1616 return paths; |
| 1615 } | 1617 } |
| OLD | NEW |