[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
eric at webkit.org
eric at webkit.org
Wed Mar 17 18:32:07 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 89837273a08feac0c22b313d8d3bb26cd173e2e2
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Mar 10 23:19:18 2010 +0000
2010-03-10 Leandro Pereira <leandro at profusion.mobi>
Reviewed by Holger Freyther.
Add EFL port files to efl/WebCoreSupport.
http://webkit.org/b/35913
* efl/WebCoreSupport/ChromeClientEfl.cpp: Added.
* efl/WebCoreSupport/ChromeClientEfl.h: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 9e46cf9..b91e320 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,13 @@
+2010-03-10 Leandro Pereira <leandro at profusion.mobi>
+
+ Reviewed by Holger Freyther.
+
+ Add EFL port files to efl/WebCoreSupport.
+ http://webkit.org/b/35913
+
+ * efl/WebCoreSupport/ChromeClientEfl.cpp: Added.
+ * efl/WebCoreSupport/ChromeClientEfl.h: Added.
+
2010-03-09 John Sullivan <sullivan at apple.com>
Fixed localized string key collision. update-webkit-localized-strings now
diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
new file mode 100644
index 0000000..d9c3849
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
@@ -0,0 +1,395 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack at kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2008 Kenneth Rohde Christiansen
+ * Copyright (C) 2008 Diego Gonzalez
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * All rights reserved.
+ *
+ * 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 "ChromeClientEfl.h"
+
+#include "CString.h"
+#include "DatabaseTracker.h"
+#include "EWebKit.h"
+#include "FloatRect.h"
+#include "FrameLoader.h"
+#include "FrameLoaderClientEfl.h"
+#include "HitTestResult.h"
+#include "IntRect.h"
+#include "KURL.h"
+#include "NotImplemented.h"
+#include "PlatformString.h"
+#include "WindowFeatures.h"
+#include "ewk_private.h"
+
+using namespace WebCore;
+
+static inline Evas_Object* kit(WebCore::Frame* frame)
+{
+ if (!frame)
+ return 0;
+
+ FrameLoaderClientEfl* client = static_cast<FrameLoaderClientEfl*>(frame->loader()->client());
+ return client ? client->webFrame() : 0;
+}
+
+namespace WebCore {
+
+ChromeClientEfl::ChromeClientEfl(Evas_Object *view)
+ : m_view(view)
+{
+}
+
+ChromeClientEfl::~ChromeClientEfl()
+{
+}
+
+void ChromeClientEfl::chromeDestroyed()
+{
+ delete this;
+}
+
+void ChromeClientEfl::focusedNodeChanged(Node*)
+{
+ notImplemented();
+}
+
+FloatRect ChromeClientEfl::windowRect()
+{
+ notImplemented();
+ return FloatRect();
+}
+
+void ChromeClientEfl::setWindowRect(const FloatRect& rect)
+{
+ notImplemented();
+}
+
+FloatRect ChromeClientEfl::pageRect()
+{
+ notImplemented();
+ return FloatRect();
+}
+
+float ChromeClientEfl::scaleFactor()
+{
+ notImplemented();
+ return 1.0;
+}
+
+void ChromeClientEfl::focus()
+{
+ evas_object_focus_set(m_view, EINA_TRUE);
+}
+
+void ChromeClientEfl::unfocus()
+{
+ evas_object_focus_set(m_view, EINA_FALSE);
+}
+
+Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features)
+{
+ notImplemented();
+ return 0;
+}
+
+void ChromeClientEfl::show()
+{
+ ewk_view_ready(m_view);
+}
+
+bool ChromeClientEfl::canRunModal()
+{
+ notImplemented();
+ return false;
+}
+
+void ChromeClientEfl::runModal()
+{
+ notImplemented();
+}
+
+void ChromeClientEfl::setToolbarsVisible(bool visible)
+{
+ ewk_view_toolbars_visible_set(m_view, visible);
+}
+
+bool ChromeClientEfl::toolbarsVisible()
+{
+ Eina_Bool visible;
+
+ ewk_view_toolbars_visible_get(m_view, &visible);
+ return visible;
+}
+
+void ChromeClientEfl::setStatusbarVisible(bool visible)
+{
+ ewk_view_statusbar_visible_set(m_view, visible);
+}
+
+bool ChromeClientEfl::statusbarVisible()
+{
+ Eina_Bool visible;
+
+ ewk_view_statusbar_visible_get(m_view, &visible);
+ return visible;
+}
+
+void ChromeClientEfl::setScrollbarsVisible(bool visible)
+{
+ ewk_view_scrollbars_visible_set(m_view, visible);
+}
+
+bool ChromeClientEfl::scrollbarsVisible()
+{
+ Eina_Bool visible;
+
+ ewk_view_scrollbars_visible_get(m_view, &visible);
+ return visible;
+}
+
+void ChromeClientEfl::setMenubarVisible(bool visible)
+{
+ ewk_view_menubar_visible_set(m_view, visible);
+}
+
+bool ChromeClientEfl::menubarVisible()
+{
+ Eina_Bool visible;
+
+ ewk_view_menubar_visible_get(m_view, &visible);
+ return visible;
+}
+
+void ChromeClientEfl::setResizable(bool)
+{
+ notImplemented();
+}
+
+void ChromeClientEfl::closeWindowSoon()
+{
+ ewk_view_stop(m_view);
+}
+
+bool ChromeClientEfl::canTakeFocus(FocusDirection)
+{
+ // This is called when cycling through links/focusable objects and we
+ // reach the last focusable object.
+ return false;
+}
+
+void ChromeClientEfl::takeFocus(FocusDirection)
+{
+ unfocus();
+}
+
+bool ChromeClientEfl::canRunBeforeUnloadConfirmPanel()
+{
+ return true;
+}
+
+bool ChromeClientEfl::runBeforeUnloadConfirmPanel(const String& message, WebCore::Frame* frame)
+{
+ return runJavaScriptConfirm(frame, message);
+}
+
+void ChromeClientEfl::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message,
+ unsigned int lineNumber, const String& sourceID)
+{
+ ewk_view_add_console_message(m_view, message.utf8().data(), lineNumber, sourceID.utf8().data());
+}
+
+void ChromeClientEfl::runJavaScriptAlert(Frame* frame, const String& message)
+{
+ ewk_view_run_javascript_alert(m_view, kit(frame), message.utf8().data());
+}
+
+bool ChromeClientEfl::runJavaScriptConfirm(Frame* frame, const String& message)
+{
+ return ewk_view_run_javascript_confirm(m_view, kit(frame), message.utf8().data());
+}
+
+bool ChromeClientEfl::runJavaScriptPrompt(Frame* frame, const String& message, const String& defaultValue, String& result)
+{
+ char* value = 0;
+ ewk_view_run_javascript_prompt(m_view, kit(frame), message.utf8().data(), defaultValue.utf8().data(), &value);
+ if (value) {
+ result = String::fromUTF8(value);
+ free(value);
+ return true;
+ }
+ return false;
+}
+
+void ChromeClientEfl::setStatusbarText(const String& string)
+{
+ ewk_view_statusbar_text_set(m_view, string.utf8().data());
+}
+
+bool ChromeClientEfl::shouldInterruptJavaScript()
+{
+ return ewk_view_should_interrupt_javascript(m_view);
+}
+
+bool ChromeClientEfl::tabsToLinks() const
+{
+ return true;
+}
+
+IntRect ChromeClientEfl::windowResizerRect() const
+{
+ notImplemented();
+ // Implementing this function will make repaint being
+ // called during resize, but as this will be done with
+ // a minor delay it adds a weird "filling" effect due
+ // to us using an evas image for showing the cairo
+ // context. So instead of implementing this function
+ // we call paint directly during resize with
+ // the new object size as its argument.
+ return IntRect();
+}
+
+void ChromeClientEfl::repaint(const IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly)
+{
+ Evas_Coord x, y, w, h;
+
+ if (!contentChanged)
+ return;
+
+ x = windowRect.x();
+ y = windowRect.y();
+ w = windowRect.width();
+ h = windowRect.height();
+ ewk_view_repaint(m_view, x, y, w, h);
+}
+
+void ChromeClientEfl::contentsSizeChanged(Frame* frame, const IntSize& size) const
+{
+ ewk_frame_contents_size_changed(kit(frame), size.width(), size.height());
+}
+
+bool ChromeClientEfl::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect& clipRect, bool canBlit, bool isMainFrame)
+{
+ ewk_view_scroll(m_view, delta.width(), delta.height(), scrollViewRect.x(), scrollViewRect.y(), scrollViewRect.width(), scrollViewRect.height(), clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height(), isMainFrame);
+ return canBlit;
+}
+
+IntRect ChromeClientEfl::windowToScreen(const IntRect& rect) const
+{
+ notImplemented();
+ return rect;
+}
+
+IntPoint ChromeClientEfl::screenToWindow(const IntPoint& point) const
+{
+ notImplemented();
+ return point;
+}
+
+PlatformPageClient ChromeClientEfl::platformPageClient() const
+{
+ return m_view;
+}
+
+void ChromeClientEfl::scrollbarsModeDidChange() const
+{
+}
+
+void ChromeClientEfl::mouseDidMoveOverElement(const HitTestResult& hit, unsigned modifierFlags)
+{
+ // FIXME, compare with old link, look at Qt impl.
+ bool isLink = hit.isLiveLink();
+ if (isLink) {
+ KURL url = hit.absoluteLinkURL();
+ if (!url.isEmpty() && url != m_hoveredLinkURL) {
+ const char *link[2];
+ TextDirection dir;
+ CString urlStr = url.prettyURL().utf8();
+ CString titleStr = hit.title(dir).utf8();
+ link[0] = urlStr.data();
+ link[1] = titleStr.data();
+ ewk_view_mouse_link_hover_in(m_view, link);
+ m_hoveredLinkURL = url;
+ }
+ } else if (!isLink && !m_hoveredLinkURL.isEmpty()) {
+ ewk_view_mouse_link_hover_out(m_view);
+ m_hoveredLinkURL = KURL();
+ }
+}
+
+void ChromeClientEfl::setToolTip(const String& toolTip, TextDirection)
+{
+ ewk_view_tooltip_text_set(m_view, toolTip.utf8().data());
+}
+
+void ChromeClientEfl::print(Frame* frame)
+{
+ notImplemented();
+}
+
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+void ChromeClientEfl::reachedMaxAppCacheSize(int64_t spaceNeeded)
+{
+ // FIXME: Free some space.
+ notImplemented();
+}
+#endif
+
+void ChromeClientEfl::exceededDatabaseQuota(Frame* frame, const String& databaseName)
+{
+ uint64_t quota = ewk_settings_web_database_default_quota_get();
+
+ if (!DatabaseTracker::tracker().hasEntryForOrigin(frame->document()->securityOrigin()))
+ DatabaseTracker::tracker().setQuota(frame->document()->securityOrigin(), quota);
+
+ ewk_view_exceeded_database_quota(m_view, kit(frame), databaseName.utf8().data());
+}
+
+void ChromeClientEfl::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser)
+{
+ notImplemented();
+}
+
+void ChromeClientEfl::formStateDidChange(const Node*)
+{
+ notImplemented();
+}
+
+bool ChromeClientEfl::setCursor(PlatformCursorHandle)
+{
+ notImplemented();
+ return false;
+}
+
+void ChromeClientEfl::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
+{
+ // See the comment in WebCore/page/ChromeClient.h
+ notImplemented();
+}
+
+}
diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
new file mode 100644
index 0000000..0e17806
--- /dev/null
+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef ChromeClientEfl_h
+#define ChromeClientEfl_h
+
+#include "ChromeClient.h"
+#include "KURL.h"
+#include <Evas.h>
+
+namespace WebCore {
+
+class ChromeClientEfl : public ChromeClient {
+public:
+ explicit ChromeClientEfl(Evas_Object *view);
+ virtual ~ChromeClientEfl();
+
+ virtual void chromeDestroyed();
+
+ virtual void setWindowRect(const FloatRect&);
+ virtual FloatRect windowRect();
+
+ virtual FloatRect pageRect();
+
+ virtual float scaleFactor();
+
+ virtual void focus();
+ virtual void unfocus();
+
+ virtual bool canTakeFocus(FocusDirection);
+ virtual void takeFocus(FocusDirection);
+
+ virtual void focusedNodeChanged(WebCore::Node*);
+
+ virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&);
+ virtual void show();
+
+ virtual bool canRunModal();
+ virtual void runModal();
+
+ virtual void setToolbarsVisible(bool);
+ virtual bool toolbarsVisible();
+
+ virtual void setStatusbarVisible(bool);
+ virtual bool statusbarVisible();
+
+ virtual void setScrollbarsVisible(bool);
+ virtual bool scrollbarsVisible();
+
+ virtual void setMenubarVisible(bool);
+ virtual bool menubarVisible();
+
+ virtual void setResizable(bool);
+
+ virtual void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message,
+ unsigned int lineNumber, const String& sourceID);
+
+ virtual bool canRunBeforeUnloadConfirmPanel();
+ virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame);
+
+ virtual void closeWindowSoon();
+
+ virtual void runJavaScriptAlert(Frame*, const String&);
+ virtual bool runJavaScriptConfirm(Frame*, const String&);
+ virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
+ virtual void setStatusbarText(const String&);
+ virtual bool shouldInterruptJavaScript();
+ virtual bool tabsToLinks() const;
+
+ virtual IntRect windowResizerRect() const;
+
+ virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
+ virtual void contentsSizeChanged(Frame*, const IntSize&) const;
+ virtual bool scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect, bool canBlit, bool isMainFrame);
+ virtual IntPoint screenToWindow(const IntPoint&) const;
+ virtual IntRect windowToScreen(const IntRect&) const;
+ virtual PlatformPageClient platformPageClient() const;
+
+ virtual void scrollbarsModeDidChange() const;
+ virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
+
+ virtual void setToolTip(const String&, TextDirection);
+
+ virtual void print(Frame*);
+
+#if ENABLE(DATABASE)
+ virtual void exceededDatabaseQuota(Frame*, const String&);
+#endif
+
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
+#endif
+
+ virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
+ virtual void formStateDidChange(const Node*);
+
+ virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
+
+ virtual bool setCursor(PlatformCursorHandle);
+
+ virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {}
+
+ virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*);
+
+ Evas_Object *m_view;
+ KURL m_hoveredLinkURL;
+};
+}
+
+#endif // ChromeClientEfl_h
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list