| 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/webkit_support.h" | 5 #include "webkit/support/webkit_support.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 // FileSystem | 771 // FileSystem |
| 772 void OpenFileSystem(WebFrame* frame, WebFileSystem::Type type, | 772 void OpenFileSystem(WebFrame* frame, WebFileSystem::Type type, |
| 773 long long size, bool create, WebFileSystemCallbacks* callbacks) { | 773 long long size, bool create, WebFileSystemCallbacks* callbacks) { |
| 774 SimpleFileSystem* fileSystem = static_cast<SimpleFileSystem*>( | 774 SimpleFileSystem* fileSystem = static_cast<SimpleFileSystem*>( |
| 775 test_environment->webkit_platform_support()->fileSystem()); | 775 test_environment->webkit_platform_support()->fileSystem()); |
| 776 fileSystem->OpenFileSystem(frame, type, size, create, callbacks); | 776 fileSystem->OpenFileSystem(frame, type, size, create, callbacks); |
| 777 } | 777 } |
| 778 | 778 |
| 779 WebKit::WebString RegisterIsolatedFileSystem( | 779 WebKit::WebString RegisterIsolatedFileSystem( |
| 780 const WebKit::WebVector<WebKit::WebString>& filenames) { | 780 const WebKit::WebVector<WebKit::WebString>& filenames) { |
| 781 std::set<FilePath> files; | 781 fileapi::IsolatedContext::FileInfoSet files; |
| 782 for (size_t i = 0; i < filenames.size(); ++i) | 782 for (size_t i = 0; i < filenames.size(); ++i) { |
| 783 files.insert(webkit_glue::WebStringToFilePath(filenames[i])); | 783 FilePath path = webkit_glue::WebStringToFilePath(filenames[i]); |
| 784 files.AddPath(path); |
| 785 } |
| 784 std::string filesystemId = | 786 std::string filesystemId = |
| 785 fileapi::IsolatedContext::GetInstance()->RegisterIsolatedFileSystem( | 787 fileapi::IsolatedContext::GetInstance()->RegisterFileSystem(files); |
| 786 files); | |
| 787 return UTF8ToUTF16(filesystemId); | 788 return UTF8ToUTF16(filesystemId); |
| 788 } | 789 } |
| 789 | 790 |
| 790 // Keyboard code | 791 // Keyboard code |
| 791 #if defined(TOOLKIT_GTK) | 792 #if defined(TOOLKIT_GTK) |
| 792 int NativeKeyCodeForWindowsKeyCode(int keycode, bool shift) { | 793 int NativeKeyCodeForWindowsKeyCode(int keycode, bool shift) { |
| 793 ui::KeyboardCode code = static_cast<ui::KeyboardCode>(keycode); | 794 ui::KeyboardCode code = static_cast<ui::KeyboardCode>(keycode); |
| 794 return ui::GdkNativeKeyCodeForWindowsKeyCode(code, shift); | 795 return ui::GdkNativeKeyCodeForWindowsKeyCode(code, shift); |
| 795 } | 796 } |
| 796 #endif | 797 #endif |
| 797 | 798 |
| 798 // Timers | 799 // Timers |
| 799 double GetForegroundTabTimerInterval() { | 800 double GetForegroundTabTimerInterval() { |
| 800 return webkit_glue::kForegroundTabTimerInterval; | 801 return webkit_glue::kForegroundTabTimerInterval; |
| 801 } | 802 } |
| 802 | 803 |
| 803 // Logging | 804 // Logging |
| 804 void EnableWebCoreLogChannels(const std::string& channels) { | 805 void EnableWebCoreLogChannels(const std::string& channels) { |
| 805 webkit_glue::EnableWebCoreLogChannels(channels); | 806 webkit_glue::EnableWebCoreLogChannels(channels); |
| 806 } | 807 } |
| 807 | 808 |
| 808 void SetGamepadData(const WebKit::WebGamepads& pads) { | 809 void SetGamepadData(const WebKit::WebGamepads& pads) { |
| 809 test_environment->webkit_platform_support()->setGamepadData(pads); | 810 test_environment->webkit_platform_support()->setGamepadData(pads); |
| 810 } | 811 } |
| 811 | 812 |
| 812 } // namespace webkit_support | 813 } // namespace webkit_support |
| OLD | NEW |