summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webframe_impl.cc3
-rw-r--r--webkit/glue/webview.h5
-rw-r--r--webkit/glue/webview_impl.cc11
-rw-r--r--webkit/glue/webview_impl.h6
4 files changed, 24 insertions, 1 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index 6c55b48..1d21d0a 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -1532,6 +1532,9 @@ void WebFrameImpl::CreateFrameView() {
frame_->setView(view);
+ if (webview_impl_->GetIsTransparent())
+ view->setTransparent(true);
+
// TODO(darin): The Mac code has a comment about this possibly being
// unnecessary. See installInFrame in WebCoreFrameBridge.mm
if (frame_->ownerRenderer())
diff --git a/webkit/glue/webview.h b/webkit/glue/webview.h
index 600338f..2a9faec 100644
--- a/webkit/glue/webview.h
+++ b/webkit/glue/webview.h
@@ -226,6 +226,11 @@ class WebView : public WebWidget {
// Returns development tools agent instance belonging to this view.
virtual WebDevToolsAgent* GetWebDevToolsAgent() = 0;
+ // Makes the webview transparent. Useful if you want to have some custom
+ // background behind it.
+ virtual void SetIsTransparent(bool is_transparent) = 0;
+ virtual bool GetIsTransparent() const = 0;
+
private:
DISALLOW_COPY_AND_ASSIGN(WebView);
};
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc
index 9906a27..0155b8b 100644
--- a/webkit/glue/webview_impl.cc
+++ b/webkit/glue/webview_impl.cc
@@ -366,7 +366,8 @@ WebViewImpl::WebViewImpl()
drag_identity_(0),
drop_effect_(DROP_EFFECT_DEFAULT),
drop_accept_(false),
- autocomplete_popup_showing_(false) {
+ autocomplete_popup_showing_(false),
+ is_transparent_(false) {
// WebKit/win/WebView.cpp does the same thing, except they call the
// KJS specific wrapper around this method. We need to have threading
// initialized because CollatorICU requires it.
@@ -1825,6 +1826,14 @@ WebDevToolsAgentImpl* WebViewImpl::GetWebDevToolsAgentImpl() {
return devtools_agent_.get();
}
+void WebViewImpl::SetIsTransparent(bool is_transparent) {
+ is_transparent_ = is_transparent;
+}
+
+bool WebViewImpl::GetIsTransparent() const {
+ return is_transparent_;
+}
+
void WebViewImpl::DidCommitLoad(bool* is_new_navigation) {
if (is_new_navigation)
*is_new_navigation = observed_new_navigation_;
diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h
index 71a5a86..0b8db72 100644
--- a/webkit/glue/webview_impl.h
+++ b/webkit/glue/webview_impl.h
@@ -125,6 +125,9 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> {
virtual WebDevToolsAgent* GetWebDevToolsAgent();
WebDevToolsAgentImpl* GetWebDevToolsAgentImpl();
+ virtual void SetIsTransparent(bool is_transparent);
+ virtual bool GetIsTransparent() const;
+
// WebViewImpl
const WebKit::WebSize& size() const { return size_; }
@@ -351,6 +354,9 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> {
scoped_ptr<WebDevToolsAgentImpl> devtools_agent_;
+ // Whether the webview is rendering transparently.
+ bool is_transparent_;
+
// HACK: current_input_event is for ChromeClientImpl::show(), until we can fix
// WebKit to pass enough information up into ChromeClient::show() so we can
// decide if the window.open event was caused by a middle-mouse click