| 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 "webkit/support/platform_support.h" | 5 #include "webkit/support/platform_support.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h.h" |
| 13 #include "base/string_piece.h" | 13 #include "base/string_piece.h" |
| 14 #include "base/win/resource_util.h" | 14 #include "base/win/resource_util.h" |
| 15 #include "grit/webkit_chromium_resources.h" | 15 #include "grit/webkit_chromium_resources.h" |
| 16 #include "grit/webkit_resources.h" | 16 #include "grit/webkit_resources.h" |
| 17 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
| 18 #include "webkit/support/test_webkit_platform_support.h" | 18 #include "webkit/support/test_webkit_platform_support.h" |
| 19 | 19 |
| 20 #define MAX_LOADSTRING 100 | 20 #define MAX_LOADSTRING 100 |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 void BeforeShutdown() { | 63 void BeforeShutdown() { |
| 64 ResourceBundle::CleanupSharedInstance(); | 64 ResourceBundle::CleanupSharedInstance(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void AfterShutdown() { | 67 void AfterShutdown() { |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace webkit_support | 70 } // namespace webkit_support |
| 71 | 71 |
| 72 string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { | 72 base::string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { |
| 73 wchar_t localized[MAX_LOADSTRING]; | 73 wchar_t localized[MAX_LOADSTRING]; |
| 74 int length = ::LoadString(::GetModuleHandle(NULL), message_id, | 74 int length = ::LoadString(::GetModuleHandle(NULL), message_id, |
| 75 localized, MAX_LOADSTRING); | 75 localized, MAX_LOADSTRING); |
| 76 if (!length && ::GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND) { | 76 if (!length && ::GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND) { |
| 77 NOTREACHED(); | 77 NOTREACHED(); |
| 78 return L"No string for this identifier!"; | 78 return L"No string for this identifier!"; |
| 79 } | 79 } |
| 80 return string16(localized, length); | 80 return base::string16(localized, length); |
| 81 } | 81 } |
| 82 | 82 |
| 83 base::StringPiece TestWebKitPlatformSupport::GetDataResource( | 83 base::StringPiece TestWebKitPlatformSupport::GetDataResource( |
| 84 int resource_id, | 84 int resource_id, |
| 85 ui::ScaleFactor scale_factor) { | 85 ui::ScaleFactor scale_factor) { |
| 86 switch (resource_id) { | 86 switch (resource_id) { |
| 87 case IDR_BROKENIMAGE: { | 87 case IDR_BROKENIMAGE: { |
| 88 // Use webkit's broken image icon (16x16) | 88 // Use webkit's broken image icon (16x16) |
| 89 static std::string broken_image_data; | 89 static std::string broken_image_data; |
| 90 if (broken_image_data.empty()) { | 90 if (broken_image_data.empty()) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 106 LOG(FATAL) << "Failed reading: " << path.value(); | 106 LOG(FATAL) << "Failed reading: " << path.value(); |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 return resize_corner_data; | 109 return resize_corner_data; |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 // TODO(flackr): Pass scale_factor to ResourceProvider. | 113 // TODO(flackr): Pass scale_factor to ResourceProvider. |
| 114 return ResourceProvider(resource_id); | 114 return ResourceProvider(resource_id); |
| 115 } | 115 } |
| OLD | NEW |