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 "printing/backend/win_helper.h" | 5 #include "printing/backend/win_helper.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_version_info.h" | 10 #include "base/file_version_info.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 if (!info_6.Init(printer)) | 317 if (!info_6.Init(printer)) |
318 return driver_info; | 318 return driver_info; |
319 | 319 |
320 std::string info[4]; | 320 std::string info[4]; |
321 if (info_6.get()->pName) | 321 if (info_6.get()->pName) |
322 info[0] = WideToUTF8(info_6.get()->pName); | 322 info[0] = WideToUTF8(info_6.get()->pName); |
323 | 323 |
324 if (info_6.get()->pDriverPath) { | 324 if (info_6.get()->pDriverPath) { |
325 scoped_ptr<FileVersionInfo> version_info( | 325 scoped_ptr<FileVersionInfo> version_info( |
326 FileVersionInfo::CreateFileVersionInfo( | 326 FileVersionInfo::CreateFileVersionInfo( |
327 FilePath(info_6.get()->pDriverPath))); | 327 base::FilePath(info_6.get()->pDriverPath))); |
328 if (version_info.get()) { | 328 if (version_info.get()) { |
329 info[1] = WideToUTF8(version_info->file_version()); | 329 info[1] = WideToUTF8(version_info->file_version()); |
330 info[2] = WideToUTF8(version_info->product_name()); | 330 info[2] = WideToUTF8(version_info->product_name()); |
331 info[3] = WideToUTF8(version_info->product_version()); | 331 info[3] = WideToUTF8(version_info->product_version()); |
332 } | 332 } |
333 } | 333 } |
334 | 334 |
335 for (size_t i = 0; i < arraysize(info); ++i) { | 335 for (size_t i = 0; i < arraysize(info); ++i) { |
336 std::replace(info[i].begin(), info[i].end(), ';', ','); | 336 std::replace(info[i].begin(), info[i].end(), ';', ','); |
337 driver_info.append(info[i]); | 337 driver_info.append(info[i]); |
338 if (i < arraysize(info) - 1) | 338 if (i < arraysize(info) - 1) |
339 driver_info.append(";"); | 339 driver_info.append(";"); |
340 } | 340 } |
341 return driver_info; | 341 return driver_info; |
342 } | 342 } |
343 | 343 |
344 } // namespace printing | 344 } // namespace printing |
OLD | NEW |