diff options
author | Kristian Monsen <kristianm@google.com> | 2010-09-30 15:42:16 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-10-07 10:59:29 +0100 |
commit | bec39347bb3bb5bf1187ccaf471d26247f28b585 (patch) | |
tree | 56bdc4c2978fbfd3d79d0d36d5d6c640ecc09cc8 /WebCore/platform/brew | |
parent | 90b7966e7815b262cd19ac25f03aaad9b21fdc06 (diff) | |
download | external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.zip external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.gz external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.bz2 |
Merge WebKit at r68651 : Initial merge by git.
Change-Id: I3d6bff59f17eedd6722723354f386fec9be8ad12
Diffstat (limited to 'WebCore/platform/brew')
-rw-r--r-- | WebCore/platform/brew/ClipboardBrew.cpp | 10 | ||||
-rw-r--r-- | WebCore/platform/brew/ClipboardBrew.h | 2 | ||||
-rw-r--r-- | WebCore/platform/brew/FileSystemBrew.cpp | 13 | ||||
-rw-r--r-- | WebCore/platform/brew/LocalizedStringsBrew.cpp | 50 | ||||
-rw-r--r-- | WebCore/platform/brew/PasteboardBrew.cpp | 93 | ||||
-rw-r--r-- | WebCore/platform/brew/PlatformKeyboardEventBrew.cpp | 4 | ||||
-rw-r--r-- | WebCore/platform/brew/PlatformTouchEventBrew.cpp | 76 | ||||
-rw-r--r-- | WebCore/platform/brew/PlatformTouchPointBrew.cpp | 41 |
8 files changed, 277 insertions, 12 deletions
diff --git a/WebCore/platform/brew/ClipboardBrew.cpp b/WebCore/platform/brew/ClipboardBrew.cpp index 720d6a6..10025d6 100644 --- a/WebCore/platform/brew/ClipboardBrew.cpp +++ b/WebCore/platform/brew/ClipboardBrew.cpp @@ -41,8 +41,8 @@ PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame* return 0; } -ClipboardBrew::ClipboardBrew(ClipboardAccessPolicy policy, bool isForDragging) - : Clipboard(policy, isForDragging) +ClipboardBrew::ClipboardBrew(ClipboardAccessPolicy policy, ClipboardType clipboardType) + : Clipboard(clipboardType, isForDragging) { } @@ -52,12 +52,12 @@ ClipboardBrew::~ClipboardBrew() void ClipboardBrew::clearData(const String&) { - ASSERT(isForDragging()); + ASSERT(isForDragAndDrop()); } void ClipboardBrew::clearAllData() { - ASSERT(isForDragging()); + ASSERT(isForDragAndDrop()); } String ClipboardBrew::getData(const String&, bool& success) const @@ -68,7 +68,7 @@ String ClipboardBrew::getData(const String&, bool& success) const bool ClipboardBrew::setData(const String&, const String&) { - ASSERT(isForDragging()); + ASSERT(isForDragAndDrop()); return false; } diff --git a/WebCore/platform/brew/ClipboardBrew.h b/WebCore/platform/brew/ClipboardBrew.h index a966db1..1faf031 100644 --- a/WebCore/platform/brew/ClipboardBrew.h +++ b/WebCore/platform/brew/ClipboardBrew.h @@ -36,7 +36,7 @@ class CachedImage; class ClipboardBrew : public Clipboard, public CachedResourceClient { public: - ClipboardBrew(ClipboardAccessPolicy policy, bool isForDragging); + ClipboardBrew(ClipboardAccessPolicy policy, ClipboardType); ~ClipboardBrew(); void clearData(const String&); diff --git a/WebCore/platform/brew/FileSystemBrew.cpp b/WebCore/platform/brew/FileSystemBrew.cpp index 88aa05b..a723e63 100644 --- a/WebCore/platform/brew/FileSystemBrew.cpp +++ b/WebCore/platform/brew/FileSystemBrew.cpp @@ -131,7 +131,7 @@ static String canonicalPath(const String& path) return canonPath; } -static bool makeAllDirectories(PassOwnPtr<IFileMgr> fileMgr, const String& path) +static bool makeAllDirectories(IFileMgr* fileManager, const String& path) { if (path == canonicalPath(AEEFS_HOME_DIR)) return true; @@ -144,7 +144,7 @@ static bool makeAllDirectories(PassOwnPtr<IFileMgr> fileMgr, const String& path) } if (lastDivPos > 0) { - if (!makeAllDirectories(fileMgr.release(), path.substring(0, lastDivPos))) + if (!makeAllDirectories(fileManager, path.substring(0, lastDivPos))) return false; } @@ -152,10 +152,10 @@ static bool makeAllDirectories(PassOwnPtr<IFileMgr> fileMgr, const String& path) // IFILEMGR_MkDir return SUCCESS when the file is successfully created or if file already exists. // So we need to check fileinfo.attrib. - IFILEMGR_MkDir(fileMgr.get(), folder.utf8().data()); + IFILEMGR_MkDir(fileManager, folder.utf8().data()); FileInfo fileInfo; - if (IFILEMGR_GetInfo(fileMgr.get(), folder.utf8().data(), &fileInfo) != SUCCESS) + if (IFILEMGR_GetInfo(fileManager, folder.utf8().data(), &fileInfo) != SUCCESS) return false; return fileInfo.attrib & _FA_DIR; @@ -165,12 +165,13 @@ bool makeAllDirectories(const String& path) { OwnPtr<IFileMgr> fileMgr = createInstance<IFileMgr>(AEECLSID_FILEMGR); - return makeAllDirectories(fileMgr.release(), canonicalPath(path)); + return makeAllDirectories(fileMgr.get(), canonicalPath(path)); } String homeDirectoryPath() { - return String(AEEFS_HOME_DIR); + const int webViewClassId = 0x010aa04c; + return String::format("fs:/~0X%08X/", webViewClassId); } String pathGetFileName(const String& path) diff --git a/WebCore/platform/brew/LocalizedStringsBrew.cpp b/WebCore/platform/brew/LocalizedStringsBrew.cpp index 1bc5985..2dfd12b 100644 --- a/WebCore/platform/brew/LocalizedStringsBrew.cpp +++ b/WebCore/platform/brew/LocalizedStringsBrew.cpp @@ -96,6 +96,56 @@ String contextMenuItemTagCopyImageToClipboard() return "Copy image to clipboard"; } +String contextMenuItemTagOpenVideoInNewWindow() +{ + return "Open video in new window"; +} + +String contextMenuItemTagOpenAudioInNewWindow() +{ + return "Open audio in new window"; +} + +String contextMenuItemTagCopyVideoLinkToClipboard() +{ + return "Copy Video link location"; +} + +String contextMenuItemTagCopyAudioLinkToClipboard() +{ + return "Copy audio link location"; +} + +String contextMenuItemTagToggleMediaControls() +{ + return "Toggle media controls"; +} + +String contextMenuItemTagToggleMediaLoop() +{ + return "Toggle media loop playback"; +} + +String contextMenuItemTagEnterVideoFullscreen() +{ + return "Switch video to fullscreen"; +} + +String contextMenuItemTagMediaPlay() +{ + return "Play"; +} + +String contextMenuItemTagMediaPause() +{ + return "Pause"; +} + +String contextMenuItemTagMediaMute() +{ + return "Mute"; +} + String contextMenuItemTagOpenFrameInNewWindow() { return "Open frame in new window"; diff --git a/WebCore/platform/brew/PasteboardBrew.cpp b/WebCore/platform/brew/PasteboardBrew.cpp new file mode 100644 index 0000000..e5049b4 --- /dev/null +++ b/WebCore/platform/brew/PasteboardBrew.cpp @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2009 Company 100, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include "config.h" +#include "Pasteboard.h" + +#include "DocumentFragment.h" +#include "NotImplemented.h" +#include "Range.h" + +#include <wtf/text/CString.h> + +namespace WebCore { + +Pasteboard* Pasteboard::generalPasteboard() +{ + static Pasteboard* pasteboard = new Pasteboard; + return pasteboard; +} + +Pasteboard::Pasteboard() +{ + notImplemented(); +} + +void Pasteboard::clear() +{ + notImplemented(); +} + +void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame) +{ + notImplemented(); +} + +void Pasteboard::writePlainText(const String& text) +{ + notImplemented(); +} + +void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame) +{ + notImplemented(); +} + +void Pasteboard::writeImage(Node* node, const KURL&, const String&) +{ + notImplemented(); +} + +bool Pasteboard::canSmartReplace() +{ + notImplemented(); + return false; +} + +String Pasteboard::plainText(Frame* frame) +{ + notImplemented(); + return String(); +} + +PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefPtr<Range> context, bool allowPlainText, bool& chosePlainText) +{ + notImplemented(); + return 0; +} + +} // namespace WebCore diff --git a/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp b/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp index d7a1279..3384a4f 100644 --- a/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp +++ b/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp @@ -98,6 +98,8 @@ static String keyIdentifierForBrewKeyCode(uint16 keyCode) return "PageUp"; case AVK_TXPGDOWN: return "PageDown"; + case AVK_FUNCTION: + return "U+0009"; default: return String::format("U+%04X", toASCIIUpper(keyCode)); } @@ -132,6 +134,8 @@ static int windowsKeyCodeForKeyEvent(uint16 code) return VK_INSERT; // (2D) INS key case AVK_TXDELETE: return VK_DELETE; // (2E) DEL key + case AVK_FUNCTION: + return VK_TAB; // (09) TAB key default: return 0; } diff --git a/WebCore/platform/brew/PlatformTouchEventBrew.cpp b/WebCore/platform/brew/PlatformTouchEventBrew.cpp new file mode 100644 index 0000000..9f31dae --- /dev/null +++ b/WebCore/platform/brew/PlatformTouchEventBrew.cpp @@ -0,0 +1,76 @@ +/* + * Copyright 2010, Company 100, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "PlatformTouchEvent.h" + +#include <AEEEvent.h> +#include <AEEPointerHelpers.h> +#include <AEEVCodes.h> + +#if ENABLE(TOUCH_EVENTS) + +namespace WebCore { + +PlatformTouchEvent::PlatformTouchEvent(AEEEvent event, uint16 wParam, uint32 dwParam) + : m_metaKey(false) +{ + PlatformTouchPoint::State state; + + switch (event) { + case EVT_POINTER_DOWN: + m_type = TouchStart; + state = PlatformTouchPoint::TouchPressed; + break; + case EVT_POINTER_UP: + m_type = TouchEnd; + state = PlatformTouchPoint::TouchReleased; + break; + case EVT_POINTER_MOVE: + case EVT_POINTER_STALE_MOVE: + m_type = TouchMove; + state = PlatformTouchPoint::TouchMoved; + break; + default: + ASSERT_NOT_REACHED(); + } + + char* dwParamStr = reinterpret_cast<char*>(dwParam); + int x, y; + AEE_POINTER_GET_XY(dwParamStr, &x, &y); + IntPoint windowPos = IntPoint(x, y); + + int id = AEE_POINTER_GET_PTRID(dwParamStr); + m_touchPoints.append(PlatformTouchPoint(id, windowPos, state)); + + uint32 keyModifiers = AEE_POINTER_GET_KEY_MODIFIERS(dwParamStr); + m_altKey = keyModifiers & (KB_LALT | KB_RALT); + m_shiftKey = keyModifiers & (KB_LSHIFT | KB_RSHIFT); + m_ctrlKey = keyModifiers & (KB_LCTRL | KB_RCTRL); +} + +} + +#endif diff --git a/WebCore/platform/brew/PlatformTouchPointBrew.cpp b/WebCore/platform/brew/PlatformTouchPointBrew.cpp new file mode 100644 index 0000000..6943182 --- /dev/null +++ b/WebCore/platform/brew/PlatformTouchPointBrew.cpp @@ -0,0 +1,41 @@ +/* + * Copyright 2010, Company 100, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "PlatformTouchPoint.h" + +#if ENABLE(TOUCH_EVENTS) + +namespace WebCore { + +PlatformTouchPoint::PlatformTouchPoint(int id, const IntPoint& windowPos, State state) + : m_id(id) + , m_state(state) + , m_screenPos(windowPos) + , m_pos(windowPos) { } + +} + +#endif |