Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / content / public / renderer / render_view.h
blobdcf1de48b91b86ddc650004fce17e9a0ef71e1e6
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_VIEW_H_
6 #define CONTENT_PUBLIC_RENDERER_RENDER_VIEW_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/strings/string16.h"
12 #include "content/common/content_export.h"
13 #include "content/public/common/top_controls_state.h"
14 #include "ipc/ipc_sender.h"
15 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
16 #include "ui/gfx/native_widget_types.h"
18 namespace blink {
19 class WebElement;
20 class WebFrame;
21 class WebLocalFrame;
22 class WebNode;
23 class WebString;
24 class WebURLRequest;
25 class WebView;
26 struct WebContextMenuData;
29 namespace gfx {
30 class Point;
31 class Size;
34 namespace content {
36 class RenderFrame;
37 class RenderViewVisitor;
38 struct SSLStatus;
39 struct WebPreferences;
41 // DEPRECATED: RenderView is being removed as part of the SiteIsolation project.
42 // New code should be added to RenderFrame instead.
44 // For context, please see https://crbug.com/467770 and
45 // http://www.chromium.org/developers/design-documents/site-isolation.
46 class CONTENT_EXPORT RenderView : public IPC::Sender {
47 public:
48 // Returns the RenderView containing the given WebView.
49 static RenderView* FromWebView(blink::WebView* webview);
51 // Returns the RenderView for the given routing ID.
52 static RenderView* FromRoutingID(int routing_id);
54 // Returns the number of live RenderView instances in this process.
55 static size_t GetRenderViewCount();
57 // Visit all RenderViews with a live WebView (i.e., RenderViews that have
58 // been closed but not yet destroyed are excluded).
59 static void ForEach(RenderViewVisitor* visitor);
61 // Applies WebKit related preferences to this view.
62 static void ApplyWebPreferences(const WebPreferences& preferences,
63 blink::WebView* web_view);
65 // Returns the main RenderFrame.
66 virtual RenderFrame* GetMainRenderFrame() = 0;
68 // Get the routing ID of the view.
69 virtual int GetRoutingID() const = 0;
71 // Returns the size of the view.
72 virtual gfx::Size GetSize() const = 0;
74 // Gets WebKit related preferences associated with this view.
75 virtual WebPreferences& GetWebkitPreferences() = 0;
77 // Overrides the WebKit related preferences associated with this view. Note
78 // that the browser process may update the preferences at any time.
79 virtual void SetWebkitPreferences(const WebPreferences& preferences) = 0;
81 // Returns the associated WebView. May return NULL when the view is closing.
82 virtual blink::WebView* GetWebView() = 0;
84 // Returns true if we should display scrollbars for the given view size and
85 // false if the scrollbars should be hidden.
86 virtual bool ShouldDisplayScrollbars(int width, int height) const = 0;
88 // Bitwise-ORed set of extra bindings that have been enabled. See
89 // BindingsPolicy for details.
90 virtual int GetEnabledBindings() const = 0;
92 // Whether content state (such as form state, scroll position and page
93 // contents) should be sent to the browser immediately. This is normally
94 // false, but set to true by some tests.
95 virtual bool GetContentStateImmediately() const = 0;
97 // Returns the current visibility of the WebView.
98 virtual blink::WebPageVisibilityState GetVisibilityState() const = 0;
100 // Used by plugins that load data in this RenderView to update the loading
101 // notifications.
102 virtual void DidStartLoading() = 0;
103 virtual void DidStopLoading() = 0;
105 // Notifies the renderer that a paint is to be generated for the size
106 // passed in.
107 virtual void Repaint(const gfx::Size& size) = 0;
109 // Inject edit commands to be used for the next keyboard event.
110 virtual void SetEditCommandForNextKeyEvent(const std::string& name,
111 const std::string& value) = 0;
112 virtual void ClearEditCommands() = 0;
114 // Returns a collection of security info about |frame|.
115 virtual SSLStatus GetSSLStatusOfFrame(blink::WebFrame* frame) const = 0;
117 // Returns |renderer_preferences_.accept_languages| value.
118 virtual const std::string& GetAcceptLanguages() const = 0;
120 #if defined(OS_ANDROID)
121 virtual void UpdateTopControlsState(TopControlsState constraints,
122 TopControlsState current,
123 bool animate) = 0;
124 #endif
126 protected:
127 ~RenderView() override {}
129 private:
130 // This interface should only be implemented inside content.
131 friend class RenderViewImpl;
132 RenderView() {}
135 } // namespace content
137 #endif // CONTENT_PUBLIC_RENDERER_RENDER_VIEW_H_