2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 * Copyright (C) 2012, Samsung Electronics. All rights reserved.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
26 #include "FocusDirection.h"
27 #include "HostWindow.h"
28 #include <wtf/Forward.h>
29 #include <wtf/RefPtr.h>
40 #if ENABLE(INPUT_TYPE_COLOR)
42 class ColorChooserClient;
51 class NavigationAction;
55 class PopupMenuClient;
56 class SearchPopupMenu;
58 struct FrameLoadRequest;
59 struct ViewportArguments;
60 struct WindowFeatures;
62 class Chrome : public HostWindow {
66 static PassOwnPtr<Chrome> create(Page*, ChromeClient*);
68 ChromeClient* client() { return m_client; }
70 // HostWindow methods.
72 virtual void invalidateRootView(const IntRect&, bool) OVERRIDE;
73 virtual void invalidateContentsAndRootView(const IntRect&, bool) OVERRIDE;
74 virtual void invalidateContentsForSlowScroll(const IntRect&, bool);
75 virtual void scroll(const IntSize&, const IntRect&, const IntRect&);
76 #if USE(TILED_BACKING_STORE)
77 virtual void delegatedScrollRequested(const IntPoint& scrollPoint);
80 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
81 virtual void requestVisibleContentRectRestore(const IntPoint& scrollOffset, float scale);
82 virtual float contentsScaleFactor() const;
85 virtual IntPoint screenToRootView(const IntPoint&) const OVERRIDE;
86 virtual IntRect rootViewToScreen(const IntRect&) const OVERRIDE;
87 virtual PlatformPageClient platformPageClient() const;
88 virtual void scrollbarsModeDidChange() const;
89 virtual void setCursor(const Cursor&);
90 virtual void setCursorHiddenUntilMouseMoves(bool);
92 #if ENABLE(REQUEST_ANIMATION_FRAME)
93 virtual void scheduleAnimation();
96 void scrollRectIntoView(const IntRect&) const;
98 void contentsSizeChanged(Frame*, const IntSize&) const;
99 void layoutUpdated(Frame*) const;
101 void setWindowRect(const FloatRect&) const;
102 FloatRect windowRect() const;
104 FloatRect pageRect() const;
107 void unfocus() const;
109 bool canTakeFocus(FocusDirection) const;
110 void takeFocus(FocusDirection) const;
112 void focusedNodeChanged(Node*) const;
113 void focusedFrameChanged(Frame*) const;
115 Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) const;
118 bool canRunModal() const;
119 bool canRunModalNow() const;
120 void runModal() const;
122 void setToolbarsVisible(bool) const;
123 bool toolbarsVisible() const;
125 void setStatusbarVisible(bool) const;
126 bool statusbarVisible() const;
128 void setScrollbarsVisible(bool) const;
129 bool scrollbarsVisible() const;
131 void setMenubarVisible(bool) const;
132 bool menubarVisible() const;
134 void setResizable(bool) const;
136 bool canRunBeforeUnloadConfirmPanel();
137 bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame);
139 void closeWindowSoon();
141 void runJavaScriptAlert(Frame*, const String&);
142 bool runJavaScriptConfirm(Frame*, const String&);
143 bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
144 void setStatusbarText(Frame*, const String&);
145 bool shouldInterruptJavaScript();
147 #if ENABLE(TIZEN_SEARCH_PROVIDER)
148 void addSearchProvider(const String&, const String&);
149 unsigned long isSearchProviderInstalled(const String&, const String&);
152 IntRect windowResizerRect() const;
154 void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
156 void setToolTip(const HitTestResult&);
160 #if ENABLE(INPUT_TYPE_COLOR)
161 PassOwnPtr<ColorChooser> createColorChooser(ColorChooserClient*, const Color& initialColor);
164 void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
165 void loadIconForFiles(const Vector<String>&, FileIconLoader*);
166 #if ENABLE(DIRECTORY_UPLOAD)
167 void enumerateChosenDirectory(FileChooser*);
170 void dispatchViewportPropertiesDidChange(const ViewportArguments&) const;
172 bool requiresFullscreenForVideoPlayback();
174 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
175 void setContentSuspendedByInspector(bool) const;
179 void focusNSView(NSView*);
182 bool selectItemWritingDirectionIsNatural();
183 bool selectItemAlignmentFollowsMenuWritingDirection();
184 bool hasOpenedPopup() const;
185 PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const;
186 PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
189 Chrome(Page*, ChromeClient*);
192 ChromeClient* m_client;