summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-23 23:19:14 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-23 23:19:14 +0000
commit699ab0da64a44444bc99108592004d1354f5f89f (patch)
tree05dd618d341567e26dc303b56baac155e5fe2d1a /webkit
parentb547fd44ca39e90e6416da8a5ffc040fa9d2446c (diff)
downloadchromium_src-699ab0da64a44444bc99108592004d1354f5f89f.zip
chromium_src-699ab0da64a44444bc99108592004d1354f5f89f.tar.gz
chromium_src-699ab0da64a44444bc99108592004d1354f5f89f.tar.bz2
Add transparency support to RenderWidgetHostView.
This is used to make the background behind toolstrips 'shine through' them. It isn't possible to make them really transparent due to cleartype (cleartype must know the pixels behind the text to work), so instead we paint the background we want behind the transparent webview. Review URL: http://codereview.chromium.org/88076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14378 0039d316-1c4b-4281-b951-d872f2087c98
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