diff options
author | Steve Block <steveblock@google.com> | 2010-08-04 11:41:34 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-08-09 12:04:44 +0100 |
commit | db14019a23d96bc8a444b6576a5da8bd1cfbc8b0 (patch) | |
tree | 9f793c5b0f5e1f2aca8247158920e2c4bf962bbf /WebCore/platform/qt | |
parent | bf916837aa84f1e4b00e6ed6268516c2acd27545 (diff) | |
download | external_webkit-db14019a23d96bc8a444b6576a5da8bd1cfbc8b0.zip external_webkit-db14019a23d96bc8a444b6576a5da8bd1cfbc8b0.tar.gz external_webkit-db14019a23d96bc8a444b6576a5da8bd1cfbc8b0.tar.bz2 |
Merge WebKit at r64523 : Initial merge by git.
Change-Id: Ibb796c6802e757b1d9b40f58205cfbe4da95fcd4
Diffstat (limited to 'WebCore/platform/qt')
-rw-r--r-- | WebCore/platform/qt/PopupMenuQt.cpp | 25 | ||||
-rw-r--r-- | WebCore/platform/qt/PopupMenuQt.h | 49 | ||||
-rw-r--r-- | WebCore/platform/qt/QtAbstractWebPopup.h | 2 | ||||
-rw-r--r-- | WebCore/platform/qt/SearchPopupMenuQt.cpp | 20 | ||||
-rw-r--r-- | WebCore/platform/qt/SearchPopupMenuQt.h | 44 |
5 files changed, 119 insertions, 21 deletions
diff --git a/WebCore/platform/qt/PopupMenuQt.cpp b/WebCore/platform/qt/PopupMenuQt.cpp index 315b891..5590556 100644 --- a/WebCore/platform/qt/PopupMenuQt.cpp +++ b/WebCore/platform/qt/PopupMenuQt.cpp @@ -24,7 +24,7 @@ */ #include "config.h" -#include "PopupMenu.h" +#include "PopupMenuQt.h" #include "Chrome.h" #include "ChromeClientQt.h" @@ -35,18 +35,24 @@ namespace WebCore { -PopupMenu::PopupMenu(PopupMenuClient* client) +PopupMenuQt::PopupMenuQt(PopupMenuClient* client) : m_popupClient(client) , m_popup(0) { } -PopupMenu::~PopupMenu() +PopupMenuQt::~PopupMenuQt() { delete m_popup; } -void PopupMenu::show(const IntRect& rect, FrameView* view, int index) + +void PopupMenuQt::disconnectClient() +{ + m_popupClient = 0; +} + +void PopupMenuQt::show(const IntRect& rect, FrameView* view, int index) { ChromeClientQt* chromeClient = static_cast<ChromeClientQt*>( view->frame()->page()->chrome()->client()); @@ -67,19 +73,14 @@ void PopupMenu::show(const IntRect& rect, FrameView* view, int index) } -void PopupMenu::hide() +void PopupMenuQt::hide() { m_popup->hide(); } -void PopupMenu::updateFromElement() -{ - client()->setTextFromItem(m_popupClient->selectedIndex()); -} - -bool PopupMenu::itemWritingDirectionIsNatural() +void PopupMenuQt::updateFromElement() { - return false; + m_popupClient->setTextFromItem(m_popupClient->selectedIndex()); } } diff --git a/WebCore/platform/qt/PopupMenuQt.h b/WebCore/platform/qt/PopupMenuQt.h new file mode 100644 index 0000000..25a9f76 --- /dev/null +++ b/WebCore/platform/qt/PopupMenuQt.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * 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 PopupMenuQt_h +#define PopupMenuQt_h + +#include "PopupMenu.h" + +namespace WebCore { + +class FrameView; +class QtAbstractWebPopup; +class Scrollbar; +class PopupMenuClient; + +class PopupMenuQt : public PopupMenu { +public: + PopupMenuQt(PopupMenuClient*); + ~PopupMenuQt(); + + virtual void show(const IntRect&, FrameView*, int index); + virtual void hide(); + virtual void updateFromElement(); + virtual void disconnectClient(); + +private: + PopupMenuClient* m_popupClient; + QtAbstractWebPopup* m_popup; +}; + +} + +#endif // PopupMenuQt_h diff --git a/WebCore/platform/qt/QtAbstractWebPopup.h b/WebCore/platform/qt/QtAbstractWebPopup.h index dad4997..5f6f619 100644 --- a/WebCore/platform/qt/QtAbstractWebPopup.h +++ b/WebCore/platform/qt/QtAbstractWebPopup.h @@ -63,7 +63,7 @@ public: QFont font() { return m_popupClient->menuStyle().font().font(); } private: - friend class PopupMenu; + friend class PopupMenuQt; PopupMenuClient* m_popupClient; QWebPageClient* m_pageClient; int m_currentIndex; diff --git a/WebCore/platform/qt/SearchPopupMenuQt.cpp b/WebCore/platform/qt/SearchPopupMenuQt.cpp index 187a5de..a05d08a 100644 --- a/WebCore/platform/qt/SearchPopupMenuQt.cpp +++ b/WebCore/platform/qt/SearchPopupMenuQt.cpp @@ -1,5 +1,6 @@ /* * Copyright C 2006 Zack Rusin <zack@kde.org> + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -18,26 +19,29 @@ */ #include "config.h" -#include "SearchPopupMenu.h" - -#include "AtomicString.h" +#include "SearchPopupMenuQt.h" namespace WebCore { -SearchPopupMenu::SearchPopupMenu(PopupMenuClient* client) - : PopupMenu(client) +SearchPopupMenuQt::SearchPopupMenuQt(PopupMenuClient* client) + : m_popup(adoptRef(new PopupMenuQt(client))) +{ +} + +PopupMenu* SearchPopupMenuQt::popupMenu() { + return m_popup.get(); } -void SearchPopupMenu::saveRecentSearches(const AtomicString&, const Vector<String>&) +void SearchPopupMenuQt::saveRecentSearches(const AtomicString&, const Vector<String>&) { } -void SearchPopupMenu::loadRecentSearches(const AtomicString&, Vector<String>&) +void SearchPopupMenuQt::loadRecentSearches(const AtomicString&, Vector<String>&) { } -bool SearchPopupMenu::enabled() +bool SearchPopupMenuQt::enabled() { return true; } diff --git a/WebCore/platform/qt/SearchPopupMenuQt.h b/WebCore/platform/qt/SearchPopupMenuQt.h new file mode 100644 index 0000000..0fbeafd --- /dev/null +++ b/WebCore/platform/qt/SearchPopupMenuQt.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * 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 SearchPopupMenuQt_h +#define SearchPopupMenuQt_h + +#include "PopupMenuQt.h" +#include "SearchPopupMenu.h" + +namespace WebCore { + +class SearchPopupMenuQt : public SearchPopupMenu { +public: + SearchPopupMenuQt(PopupMenuClient*); + + virtual PopupMenu* popupMenu(); + virtual void saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems); + virtual void loadRecentSearches(const AtomicString& name, Vector<String>& searchItems); + virtual bool enabled(); + +private: + RefPtr<PopupMenuQt> m_popup; +}; + +} + +#endif // SearchPopupMenuQt_h |