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