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 "content/renderer/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 &mime_type)); | 519 &mime_type)); |
520 return base::ASCIIToUTF16(mime_type); | 520 return base::ASCIIToUTF16(mime_type); |
521 } | 521 } |
522 | 522 |
523 //------------------------------------------------------------------------------ | 523 //------------------------------------------------------------------------------ |
524 | 524 |
525 bool RendererWebKitPlatformSupportImpl::FileUtilities::getFileInfo( | 525 bool RendererWebKitPlatformSupportImpl::FileUtilities::getFileInfo( |
526 const WebString& path, | 526 const WebString& path, |
527 WebFileInfo& web_file_info) { | 527 WebFileInfo& web_file_info) { |
528 base::File::Info file_info; | 528 base::File::Info file_info; |
529 base::File::Error status; | 529 base::File::Error status = base::File::FILE_ERROR_MAX; |
530 if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileInfo( | 530 if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileInfo( |
531 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) || | 531 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) || |
532 status != base::File::FILE_OK) { | 532 status != base::File::FILE_OK) { |
533 return false; | 533 return false; |
534 } | 534 } |
535 FileInfoToWebFileInfo(file_info, &web_file_info); | 535 FileInfoToWebFileInfo(file_info, &web_file_info); |
536 web_file_info.platformPath = path; | 536 web_file_info.platformPath = path; |
537 return true; | 537 return true; |
538 } | 538 } |
539 | 539 |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 battery_status_dispatcher_->SetListener(listener); | 1145 battery_status_dispatcher_->SetListener(listener); |
1146 } | 1146 } |
1147 | 1147 |
1148 // static | 1148 // static |
1149 void RendererWebKitPlatformSupportImpl::MockBatteryStatusChangedForTesting( | 1149 void RendererWebKitPlatformSupportImpl::MockBatteryStatusChangedForTesting( |
1150 const blink::WebBatteryStatus& status) { | 1150 const blink::WebBatteryStatus& status) { |
1151 g_test_battery_status_dispatcher.Get().PostBatteryStatusChange(status); | 1151 g_test_battery_status_dispatcher.Get().PostBatteryStatusChange(status); |
1152 } | 1152 } |
1153 | 1153 |
1154 } // namespace content | 1154 } // namespace content |
OLD | NEW |