Remove work-around patch for naver
[framework/web/webkit-efl.git] / Source / WebCore / page / Chrome.h
1 /*
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.
5  *
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.
10  *
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.
15  *
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.
20  */
21
22 #ifndef Chrome_h
23 #define Chrome_h
24
25 #include "Cursor.h"
26 #include "FocusDirection.h"
27 #include "HostWindow.h"
28 #include <wtf/Forward.h>
29 #include <wtf/RefPtr.h>
30
31 #if PLATFORM(MAC)
32 #ifndef __OBJC__
33 class NSView;
34 #endif
35 #endif
36
37 namespace WebCore {
38
39     class ChromeClient;
40 #if ENABLE(INPUT_TYPE_COLOR)
41     class ColorChooser;
42     class ColorChooserClient;
43 #endif
44     class FileChooser;
45     class FileIconLoader;
46     class FloatRect;
47     class Frame;
48     class Geolocation;
49     class HitTestResult;
50     class IntRect;
51     class NavigationAction;
52     class Node;
53     class Page;
54     class PopupMenu;
55     class PopupMenuClient;
56     class SearchPopupMenu;
57
58     struct FrameLoadRequest;
59     struct ViewportArguments;
60     struct WindowFeatures;
61     
62     class Chrome : public HostWindow {
63     public:
64         ~Chrome();
65
66         static PassOwnPtr<Chrome> create(Page*, ChromeClient*);
67
68         ChromeClient* client() { return m_client; }
69
70         // HostWindow methods.
71
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);
78 #endif
79
80 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
81         virtual void requestVisibleContentRectRestore(const IntPoint& scrollOffset, float scale);
82         virtual float contentsScaleFactor() const;
83 #endif
84
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);
91
92 #if ENABLE(REQUEST_ANIMATION_FRAME)
93         virtual void scheduleAnimation();
94 #endif
95
96         void scrollRectIntoView(const IntRect&) const;
97
98         void contentsSizeChanged(Frame*, const IntSize&) const;
99         void layoutUpdated(Frame*) const;
100
101         void setWindowRect(const FloatRect&) const;
102         FloatRect windowRect() const;
103
104         FloatRect pageRect() const;
105         
106         void focus() const;
107         void unfocus() const;
108
109         bool canTakeFocus(FocusDirection) const;
110         void takeFocus(FocusDirection) const;
111
112         void focusedNodeChanged(Node*) const;
113         void focusedFrameChanged(Frame*) const;
114
115         Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) const;
116         void show() const;
117
118         bool canRunModal() const;
119         bool canRunModalNow() const;
120         void runModal() const;
121
122         void setToolbarsVisible(bool) const;
123         bool toolbarsVisible() const;
124         
125         void setStatusbarVisible(bool) const;
126         bool statusbarVisible() const;
127         
128         void setScrollbarsVisible(bool) const;
129         bool scrollbarsVisible() const;
130         
131         void setMenubarVisible(bool) const;
132         bool menubarVisible() const;
133         
134         void setResizable(bool) const;
135
136         bool canRunBeforeUnloadConfirmPanel();
137         bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame);
138
139         void closeWindowSoon();
140
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();
146
147 #if ENABLE(TIZEN_SEARCH_PROVIDER)
148         void addSearchProvider(const String&, const String&);
149         unsigned long isSearchProviderInstalled(const String&, const String&);
150 #endif
151
152         IntRect windowResizerRect() const;
153
154         void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
155
156         void setToolTip(const HitTestResult&);
157
158         void print(Frame*);
159
160 #if ENABLE(INPUT_TYPE_COLOR)
161         PassOwnPtr<ColorChooser> createColorChooser(ColorChooserClient*, const Color& initialColor);
162 #endif
163
164         void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
165         void loadIconForFiles(const Vector<String>&, FileIconLoader*);
166 #if ENABLE(DIRECTORY_UPLOAD)
167         void enumerateChosenDirectory(FileChooser*);
168 #endif
169
170         void dispatchViewportPropertiesDidChange(const ViewportArguments&) const;
171
172         bool requiresFullscreenForVideoPlayback();
173
174 #if ENABLE(TIZEN_WEBKIT2_NOTIFY_SUSPEND_BY_REMOTE_WEB_INSPECTOR)
175         void setContentSuspendedByInspector(bool) const;
176 #endif
177
178 #if PLATFORM(MAC)
179         void focusNSView(NSView*);
180 #endif
181
182         bool selectItemWritingDirectionIsNatural();
183         bool selectItemAlignmentFollowsMenuWritingDirection();
184         bool hasOpenedPopup() const;
185         PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const;
186         PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
187
188     private:
189         Chrome(Page*, ChromeClient*);
190
191         Page* m_page;
192         ChromeClient* m_client;
193     };
194 }
195
196 #endif // Chrome_h