diff options
17 files changed, 135 insertions, 189 deletions
diff --git a/chrome/browser/ui/constrained_window_tab_helper.cc b/chrome/browser/ui/constrained_window_tab_helper.cc index 92acd63..16912a5 100644 --- a/chrome/browser/ui/constrained_window_tab_helper.cc +++ b/chrome/browser/ui/constrained_window_tab_helper.cc @@ -8,6 +8,7 @@ #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h" +#include "chrome/common/render_messages.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host_view.h" #include "content/browser/tab_contents/navigation_details.h" @@ -73,14 +74,13 @@ void ConstrainedWindowTabHelper::BlockTabContent(bool blocked) { return; } - RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView(); - // 70% opaque grey. - SkColor greyish = SkColorSetARGB(178, 0, 0, 0); - if (rwhv) - rwhv->SetVisuallyDeemphasized(blocked ? &greyish : NULL, false); // RenderViewHost may be NULL during shutdown. - if (contents->render_view_host()) - contents->render_view_host()->set_ignore_input_events(blocked); + RenderViewHost* host = contents->render_view_host(); + if (host) { + host->set_ignore_input_events(blocked); + host->Send( + new ChromeViewMsg_SetVisuallyDeemphasized(host->routing_id(), blocked)); + } if (delegate_) delegate_->SetTabContentBlocked(wrapper_, blocked); } diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi index 7a00b52..5fc04aa 100644 --- a/chrome/chrome_renderer.gypi +++ b/chrome/chrome_renderer.gypi @@ -194,6 +194,8 @@ 'renderer/visitedlink_slave.h', 'renderer/weak_v8_function_map.cc', 'renderer/weak_v8_function_map.h', + 'renderer/webview_color_overlay.cc', + 'renderer/webview_color_overlay.h', ], 'conditions': [ ['disable_nacl!=1', { diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 459f13d..deb84a2 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -285,6 +285,11 @@ IPC_MESSAGE_ROUTED4(ChromeViewMsg_DetermineIfPageSupportsInstant, int /* selection_start */, int /* selection_end */) +// Toggles visual muting of the render view area. This is on when a constrained +// window is showing. +IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetVisuallyDeemphasized, + bool /* deemphazied */) + // Tells the renderer to translate the page contents from one language to // another. IPC_MESSAGE_ROUTED4(ChromeViewMsg_TranslatePage, diff --git a/chrome/renderer/chrome_render_view_observer.cc b/chrome/renderer/chrome_render_view_observer.cc index d4451c5..d352fe5 100644 --- a/chrome/renderer/chrome_render_view_observer.cc +++ b/chrome/renderer/chrome_render_view_observer.cc @@ -27,6 +27,7 @@ #include "chrome/renderer/prerender/prerender_helper.h" #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" #include "chrome/renderer/translate_helper.h" +#include "chrome/renderer/webview_color_overlay.h" #include "content/public/common/bindings_policy.h" #include "content/public/renderer/render_view.h" #include "content/public/renderer/content_renderer_client.h" @@ -47,6 +48,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/favicon_size.h" +#include "ui/gfx/size.h" #include "ui/gfx/skbitmap_operations.h" #include "webkit/glue/image_decoder.h" #include "webkit/glue/image_resource_fetcher.h" @@ -259,6 +261,8 @@ bool ChromeRenderViewObserver::OnMessageReceived(const IPC::Message& message) { OnSetAllowRunningInsecureContent) IPC_MESSAGE_HANDLER(ChromeViewMsg_SetClientSidePhishingDetection, OnSetClientSidePhishingDetection) + IPC_MESSAGE_HANDLER(ChromeViewMsg_SetVisuallyDeemphasized, + OnSetVisuallyDeemphasized) #if defined(OS_CHROMEOS) IPC_MESSAGE_HANDLER(ChromeViewMsg_StartFrameSniffer, OnStartFrameSniffer) #endif @@ -380,6 +384,21 @@ void ChromeRenderViewObserver::OnSetClientSidePhishingDetection( #endif } +void ChromeRenderViewObserver::OnSetVisuallyDeemphasized(bool deemphasized) { + bool already_deemphasized = !!dimmed_color_overlay_.get(); + if (already_deemphasized == deemphasized) + return; + + if (deemphasized) { + // 70% opaque grey. + SkColor greyish = SkColorSetARGB(178, 0, 0, 0); + dimmed_color_overlay_.reset( + new WebViewColorOverlay(render_view(), greyish)); + } else { + dimmed_color_overlay_.reset(); + } +} + void ChromeRenderViewObserver::OnStartFrameSniffer(const string16& frame_name) { new FrameSniffer(render_view(), frame_name); } diff --git a/chrome/renderer/chrome_render_view_observer.h b/chrome/renderer/chrome_render_view_observer.h index 4f995b1..bbaa13e 100644 --- a/chrome/renderer/chrome_render_view_observer.h +++ b/chrome/renderer/chrome_render_view_observer.h @@ -25,10 +25,12 @@ class ExternalHostBindings; class SkBitmap; class TranslateHelper; struct ThumbnailScore; +class WebViewColorOverlay; namespace WebKit { class WebView; } + namespace safe_browsing { class PhishingClassifierDelegate; } @@ -127,6 +129,7 @@ class ChromeRenderViewObserver : public content::RenderViewObserver, void OnSetAllowDisplayingInsecureContent(bool allow); void OnSetAllowRunningInsecureContent(bool allow); void OnSetClientSidePhishingDetection(bool enable_phishing_detection); + void OnSetVisuallyDeemphasized(bool deemphasized); void OnStartFrameSniffer(const string16& frame_name); void OnGetFPS(); void OnAddStrictSecurityHost(const std::string& host); @@ -220,6 +223,9 @@ class ChromeRenderViewObserver : public content::RenderViewObserver, // ImageResourceFetchers schedule via DownloadImage. ImageResourceFetcherList image_fetchers_; + // A color page overlay when visually de-emaphasized. + scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; + DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); }; diff --git a/chrome/renderer/webview_color_overlay.cc b/chrome/renderer/webview_color_overlay.cc new file mode 100644 index 0000000..c300dfd --- /dev/null +++ b/chrome/renderer/webview_color_overlay.cc @@ -0,0 +1,49 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/renderer/webview_color_overlay.h" + +#include "base/logging.h" +#include "content/public/renderer/render_view.h" +#include "third_party/skia/include/core/SkCanvas.h" +#include "third_party/skia/include/core/SkPaint.h" +#include "third_party/skia/include/core/SkRect.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" +#include "ui/gfx/size.h" +#include "ui/gfx/skia_util.h" + +#if WEBKIT_USING_CG +#include "skia/ext/skia_utils_mac.h" +#endif + +WebViewColorOverlay::WebViewColorOverlay(content::RenderView* render_view, + SkColor color) + : render_view_(render_view), + color_(color) { + render_view_->GetWebView()->addPageOverlay(this, 0); +} + +WebViewColorOverlay::~WebViewColorOverlay() { + render_view_->GetWebView()->removePageOverlay(this); +} + +void WebViewColorOverlay::paintPageOverlay(WebKit::WebCanvas* canvas) { + SkRect rect = gfx::RectToSkRect(gfx::Rect(render_view_->GetSize())); + +#if WEBKIT_USING_SKIA + SkPaint paint; + paint.setColor(color_); + paint.setStyle(SkPaint::kFill_Style); + canvas->drawRect(rect, paint); +#elif WEBKIT_USING_CG + CGContextSaveGState(canvas); + CGColorRef color = gfx::SkColorToCGColorRef(color_); + CGContextSetFillColorWithColor(canvas, color); + CGColorRelease(color); + CGContextFillRect(canvas, gfx::SkRectToCGRect(rect)); + CGContextRestoreGState(canvas); +#else + NOTIMPLEMENTED(); +#endif +} diff --git a/chrome/renderer/webview_color_overlay.h b/chrome/renderer/webview_color_overlay.h new file mode 100644 index 0000000..3592637 --- /dev/null +++ b/chrome/renderer/webview_color_overlay.h @@ -0,0 +1,35 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_ +#define CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_ +#pragma once + +#include "base/basictypes.h" +#include "base/compiler_specific.h" +#include "third_party/skia/include/core/SkColor.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebPageOverlay.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" + +namespace content { +class RenderView; +} + +// This class draws the given color on a PageOverlay of a WebView. +class WebViewColorOverlay : public WebKit::WebPageOverlay { + public: + WebViewColorOverlay(content::RenderView* render_view, SkColor color); + virtual ~WebViewColorOverlay(); + + private: + // WebKit::WebPageOverlay implementation: + virtual void paintPageOverlay(WebKit::WebCanvas* canvas); + + content::RenderView* render_view_; + SkColor color_; + + DISALLOW_COPY_AND_ASSIGN(WebViewColorOverlay); +}; + +#endif // CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_ diff --git a/content/browser/renderer_host/render_widget_host_view.h b/content/browser/renderer_host/render_widget_host_view.h index da26576..5830ad33 100644 --- a/content/browser/renderer_host/render_widget_host_view.h +++ b/content/browser/renderer_host/render_widget_host_view.h @@ -288,14 +288,6 @@ class RenderWidgetHostView { virtual gfx::PluginWindowHandle GetCompositingSurface() = 0; - // Toggles visual muting of the render view area. This is on when a - // constrained window is showing, for example. |color| is the shade of - // the overlay that covers the render view. If |animate| is true, the overlay - // gradually fades in; otherwise it takes effect immediately. To remove the - // fade effect, pass a NULL value for |color|. In this case, |animate| is - // ignored. - virtual void SetVisuallyDeemphasized(const SkColor* color, bool animate) = 0; - virtual void UnhandledWheelEvent(const WebKit::WebMouseWheelEvent& event) = 0; virtual void SetHasHorizontalScrollbar(bool has_horizontal_scrollbar) = 0; diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index c642aca..90d23e0 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -409,12 +409,6 @@ gfx::Rect RenderWidgetHostViewAura::GetRootWindowBounds() { return window_->GetScreenBounds(); } -void RenderWidgetHostViewAura::SetVisuallyDeemphasized(const SkColor* color, - bool animate) { - // http://crbug.com/102568 - NOTIMPLEMENTED(); -} - void RenderWidgetHostViewAura::UnhandledWheelEvent( const WebKit::WebMouseWheelEvent& event) { // Not needed. Mac-only. diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index ebd0e44..28dfe4e 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -93,8 +93,6 @@ class CONTENT_EXPORT RenderWidgetHostViewAura virtual void SetBackground(const SkBitmap& background) OVERRIDE; virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE; virtual gfx::Rect GetRootWindowBounds() OVERRIDE; - virtual void SetVisuallyDeemphasized(const SkColor* color, - bool animate) OVERRIDE; virtual void UnhandledWheelEvent( const WebKit::WebMouseWheelEvent& event) OVERRIDE; virtual void SetHasHorizontalScrollbar( diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc index fedcbd2..2efe680 100644 --- a/content/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc @@ -57,9 +57,6 @@ namespace { const int kMaxWindowWidth = 4000; const int kMaxWindowHeight = 4000; -// The duration of the fade-out animation. See |overlay_animation_|. -const int kFadeEffectDuration = 300; - #if defined(OS_CHROMEOS) // TODO(davemoore) Under Chromeos we are increasing the rate that the trackpad // generates events to get better precisions. Eventually we will coordinate the @@ -567,8 +564,6 @@ RenderWidgetHostViewGtk::RenderWidgetHostViewGtk(RenderWidgetHost* widget_host) is_hidden_(false), is_loading_(false), is_showing_context_menu_(false), - overlay_color_(0), - overlay_animation_(this), parent_(NULL), is_popup_first_mouse_release_(true), was_imcontext_focused_before_grab_(false), @@ -590,8 +585,6 @@ RenderWidgetHostViewGtk::~RenderWidgetHostViewGtk() { void RenderWidgetHostViewGtk::InitAsChild() { DoSharedInit(); - overlay_animation_.SetDuration(kFadeEffectDuration); - overlay_animation_.SetSlideDuration(kFadeEffectDuration); gtk_widget_show(view_.get()); } @@ -1110,45 +1103,8 @@ void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) { // period where this object isn't attached to a window but hasn't been // Destroy()ed yet and it receives paint messages... if (window) { - if (SkColorGetA(overlay_color_) == 0) { - // In the common case, use XCopyArea. We don't draw more than once, so - // we don't need to double buffer. - backing_store->XShowRect(gfx::Point(0, 0), - paint_rect, ui::GetX11WindowFromGtkWidget(view_.get())); - } else { - // If the grey blend is showing, we make two drawing calls. Use double - // buffering to prevent flicker. Use CairoShowRect because XShowRect - // shortcuts GDK's double buffering. We won't be able to draw outside - // of |damage_rect|, so invalidate the difference between |paint_rect| - // and |damage_rect|. - if (paint_rect != damage_rect) { - GdkRectangle extra_gdk_rect = - paint_rect.Subtract(damage_rect).ToGdkRectangle(); - gdk_window_invalidate_rect(window, &extra_gdk_rect, false); - } - - GdkRectangle rect = { damage_rect.x(), damage_rect.y(), - damage_rect.width(), damage_rect.height() }; - gdk_window_begin_paint_rect(window, &rect); - - backing_store->CairoShowRect(damage_rect, GDK_DRAWABLE(window)); - - cairo_t* cr = gdk_cairo_create(window); - gdk_cairo_rectangle(cr, &rect); - SkColor overlay = SkColorSetA( - overlay_color_, - SkColorGetA(overlay_color_) * - overlay_animation_.GetCurrentValue()); - float r = SkColorGetR(overlay) / 255.; - float g = SkColorGetG(overlay) / 255.; - float b = SkColorGetB(overlay) / 255.; - float a = SkColorGetA(overlay) / 255.; - cairo_set_source_rgba(cr, r, g, b, a); - cairo_fill(cr); - cairo_destroy(cr); - - gdk_window_end_paint(window); - } + backing_store->XShowRect(gfx::Point(0, 0), + paint_rect, ui::GetX11WindowFromGtkWidget(view_.get())); } if (!whiteout_start_time_.is_null()) { base::TimeDelta whiteout_duration = base::TimeTicks::Now() - @@ -1206,24 +1162,6 @@ void RenderWidgetHostViewGtk::DestroyPluginContainer( plugin_container_manager_.DestroyPluginContainer(id); } -void RenderWidgetHostViewGtk::SetVisuallyDeemphasized( - const SkColor* color, bool animate) { - // Do nothing unless |color| has changed, meaning |animate| is only - // respected for the first call. - if (color && (*color == overlay_color_)) - return; - - overlay_color_ = color ? *color : 0; - - if (animate) { - overlay_animation_.Reset(); - overlay_animation_.Show(); - } else { - overlay_animation_.Reset(1.0); - gtk_widget_queue_draw(view_.get()); - } -} - void RenderWidgetHostViewGtk::UnhandledWheelEvent( const WebKit::WebMouseWheelEvent& event) { } @@ -1363,20 +1301,6 @@ void RenderWidgetHostViewGtk::ForwardKeyboardEvent( host_->ForwardKeyboardEvent(event); } -void RenderWidgetHostViewGtk::AnimationEnded(const ui::Animation* animation) { - gtk_widget_queue_draw(view_.get()); -} - -void RenderWidgetHostViewGtk::AnimationProgressed( - const ui::Animation* animation) { - gtk_widget_queue_draw(view_.get()); -} - -void RenderWidgetHostViewGtk::AnimationCanceled( - const ui::Animation* animation) { - gtk_widget_queue_draw(view_.get()); -} - void RenderWidgetHostViewGtk::set_last_mouse_down(GdkEventButton* event) { GdkEventButton* temp = NULL; if (event) { diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.h b/content/browser/renderer_host/render_widget_host_view_gtk.h index 8eb1a29..43deaa7 100644 --- a/content/browser/renderer_host/render_widget_host_view_gtk.h +++ b/content/browser/renderer_host/render_widget_host_view_gtk.h @@ -44,8 +44,7 @@ typedef struct _GtkSelectionData GtkSelectionData; // ----------------------------------------------------------------------------- // See comments in render_widget_host_view.h about this class and its members. // ----------------------------------------------------------------------------- -class CONTENT_EXPORT RenderWidgetHostViewGtk : public RenderWidgetHostView, - public ui::AnimationDelegate { +class CONTENT_EXPORT RenderWidgetHostViewGtk : public RenderWidgetHostView { public: explicit RenderWidgetHostViewGtk(RenderWidgetHost* widget); virtual ~RenderWidgetHostViewGtk(); @@ -104,8 +103,6 @@ class CONTENT_EXPORT RenderWidgetHostViewGtk : public RenderWidgetHostView, virtual void SetBackground(const SkBitmap& background) OVERRIDE; virtual void CreatePluginContainer(gfx::PluginWindowHandle id) OVERRIDE; virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) OVERRIDE; - virtual void SetVisuallyDeemphasized(const SkColor* color, - bool animate) OVERRIDE; virtual void UnhandledWheelEvent( const WebKit::WebMouseWheelEvent& event) OVERRIDE; virtual void SetHasHorizontalScrollbar( @@ -118,11 +115,6 @@ class CONTENT_EXPORT RenderWidgetHostViewGtk : public RenderWidgetHostView, virtual bool LockMouse() OVERRIDE; virtual void UnlockMouse() OVERRIDE; - // ui::AnimationDelegate implementation. - virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; - virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; - virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; - gfx::NativeView native_view() const { return view_.get(); } // If the widget is aligned with an edge of the monitor its on and the user @@ -223,14 +215,6 @@ class CONTENT_EXPORT RenderWidgetHostViewGtk : public RenderWidgetHostView, // The time it took after this view was selected for it to be fully painted. base::TimeTicks tab_switch_paint_time_; - // A color we use to shade the entire render view. If 100% transparent, we do - // not shade the render view. - SkColor overlay_color_; - - // The animation used for the abovementioned shade effect. The animation's - // value affects the alpha we use for |overlay_color_|. - ui::SlideAnimation overlay_animation_; - // The native view of our parent widget. Used only for popups. GtkWidget* parent_; diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h index aad12de..074b88d 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h @@ -278,9 +278,6 @@ class RenderWidgetHostViewMac : public RenderWidgetHostView { // to be reloaded. void ForceTextureReload(); - virtual void SetVisuallyDeemphasized(const SkColor* color, - bool animate) OVERRIDE; - virtual void UnhandledWheelEvent( const WebKit::WebMouseWheelEvent& event) OVERRIDE; virtual void SetHasHorizontalScrollbar( diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index 4e16f87..d09b0e6 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -987,11 +987,6 @@ void RenderWidgetHostViewMac::ForceTextureReload() { plugin_container_manager_.ForceTextureReload(); } -void RenderWidgetHostViewMac::SetVisuallyDeemphasized(const SkColor* color, - bool animate) { - // This is not used on mac. -} - void RenderWidgetHostViewMac::UnhandledWheelEvent( const WebKit::WebMouseWheelEvent& event) { [cocoa_view_ gotUnhandledWheelEvent]; diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc index be206c3..e315a5f 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.cc +++ b/content/browser/renderer_host/render_widget_host_view_win.cc @@ -153,31 +153,6 @@ BOOL CALLBACK DetachPluginWindowsCallback(HWND window, LPARAM param) { return TRUE; } -// Draw the contents of |backing_store_dc| onto |paint_rect| with a 70% grey -// filter. -void DrawDeemphasized(const SkColor& color, - const gfx::Rect& paint_rect, - HDC backing_store_dc, - HDC paint_dc) { - gfx::CanvasSkia canvas(paint_rect.width(), paint_rect.height(), true); - { - skia::ScopedPlatformPaint scoped_platform_paint(canvas.sk_canvas()); - HDC dc = scoped_platform_paint.GetPlatformSurface(); - BitBlt(dc, - 0, - 0, - paint_rect.width(), - paint_rect.height(), - backing_store_dc, - paint_rect.x(), - paint_rect.y(), - SRCCOPY); - } - canvas.FillRect(color, gfx::Rect(gfx::Point(), paint_rect.size())); - skia::DrawToNativeContext(canvas.sk_canvas(), paint_dc, paint_rect.x(), - paint_rect.y(), NULL); -} - // The plugin wrapper window which lives in the browser process has this proc // as its window procedure. We only handle the WM_PARENTNOTIFY message sent by // windowed plugins for mouse input. This is forwarded off to the wrappers @@ -331,7 +306,6 @@ RenderWidgetHostViewWin::RenderWidgetHostViewWin(RenderWidgetHost* widget) weak_factory_(this), parent_hwnd_(NULL), is_loading_(false), - overlay_color_(0), text_input_type_(ui::TEXT_INPUT_TYPE_NONE), is_fullscreen_(false), ignore_mouse_movement_(true), @@ -870,19 +844,6 @@ void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) { render_widget_host_->SetBackground(background); } -void RenderWidgetHostViewWin::SetVisuallyDeemphasized(const SkColor* color, - bool animate) { - // |animate| is not yet implemented, and currently isn't used. - CHECK(!animate); - - SkColor overlay_color = color ? *color : 0; - if (overlay_color_ == overlay_color) - return; - overlay_color_ = overlay_color; - - InvalidateRect(NULL, FALSE); -} - void RenderWidgetHostViewWin::UnhandledWheelEvent( const WebKit::WebMouseWheelEvent& event) { } @@ -1037,22 +998,15 @@ void RenderWidgetHostViewWin::OnPaint(HDC unused_dc) { for (DWORD i = 0; i < region_data->rdh.nCount; ++i) { gfx::Rect paint_rect = bitmap_rect.Intersect(gfx::Rect(region_rects[i])); if (!paint_rect.IsEmpty()) { - if (SkColorGetA(overlay_color_) > 0) { - DrawDeemphasized(overlay_color_, - paint_rect, - backing_store->hdc(), - paint_dc.m_hDC); - } else { - BitBlt(paint_dc.m_hDC, - paint_rect.x(), - paint_rect.y(), - paint_rect.width(), - paint_rect.height(), - backing_store->hdc(), - paint_rect.x(), - paint_rect.y(), - SRCCOPY); - } + BitBlt(paint_dc.m_hDC, + paint_rect.x(), + paint_rect.y(), + paint_rect.width(), + paint_rect.height(), + backing_store->hdc(), + paint_rect.x(), + paint_rect.y(), + SRCCOPY); } } diff --git a/content/browser/renderer_host/render_widget_host_view_win.h b/content/browser/renderer_host/render_widget_host_view_win.h index 0424f7a..2224b55 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.h +++ b/content/browser/renderer_host/render_widget_host_view_win.h @@ -193,8 +193,6 @@ class RenderWidgetHostViewWin virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE; virtual void OnAcceleratedCompositingStateChange() OVERRIDE; virtual void SetBackground(const SkBitmap& background) OVERRIDE; - virtual void SetVisuallyDeemphasized(const SkColor* color, - bool animate) OVERRIDE; virtual void UnhandledWheelEvent( const WebKit::WebMouseWheelEvent& event) OVERRIDE; virtual void SetHasHorizontalScrollbar( @@ -462,10 +460,6 @@ class RenderWidgetHostViewWin // The time it took after this view was selected for it to be fully painted. base::TimeTicks tab_switch_paint_time_; - // A color we use to shade the entire render view. If 100% transparent, we do - // not shade the render view. - SkColor overlay_color_; - // Registrar so we can listen to RENDERER_PROCESS_TERMINATED events. content::NotificationRegistrar registrar_; diff --git a/content/browser/renderer_host/test_render_view_host.h b/content/browser/renderer_host/test_render_view_host.h index 5f892f1..b8af6a3 100644 --- a/content/browser/renderer_host/test_render_view_host.h +++ b/content/browser/renderer_host/test_render_view_host.h @@ -126,8 +126,6 @@ class TestRenderWidgetHostView : public RenderWidgetHostView { virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE {} virtual gfx::Rect GetRootWindowBounds() OVERRIDE; #endif - virtual void SetVisuallyDeemphasized(const SkColor* color, - bool animate) OVERRIDE { } virtual void UnhandledWheelEvent( const WebKit::WebMouseWheelEvent& event) OVERRIDE { } virtual void SetHasHorizontalScrollbar( |