diff options
author | tschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-05 22:01:54 +0000 |
---|---|---|
committer | tschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-05 22:01:54 +0000 |
commit | 78c7977d2fc51cb7b24f1eb69e1bce64b71cb51a (patch) | |
tree | 6175aad4900e5d8cecff970711c5c58dd436e44a /o3d/core/win | |
parent | f6ee0a018e7b1f4ff5e63da7e8c388041acad2c3 (diff) | |
download | chromium_src-78c7977d2fc51cb7b24f1eb69e1bce64b71cb51a.zip chromium_src-78c7977d2fc51cb7b24f1eb69e1bce64b71cb51a.tar.gz chromium_src-78c7977d2fc51cb7b24f1eb69e1bce64b71cb51a.tar.bz2 |
Introduce two new GYP variables:
1) plugin_domain_whitelist, which sets an optional domain whitelist. If specified, websites not in the list can't use the plugin.
2) plugin_enable_fullscreen_msg, which can be optionally unset to disable the Win/Mac fullscreen message.
Also fix a bug in NPPluginProxy that this uncovered.
TEST=built on Windows with a whitelist and without fullscreen message and verified correct behaviour in both IE and FF. Also, the whitelist logic comes almost verbatim from another Google product where it is already well-tested
BUG=none
Review URL: http://codereview.chromium.org/668078
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/core/win')
-rw-r--r-- | o3d/core/win/d3d9/renderer_d3d9.cc | 24 | ||||
-rw-r--r-- | o3d/core/win/d3d9/renderer_d3d9.h | 4 |
2 files changed, 26 insertions, 2 deletions
diff --git a/o3d/core/win/d3d9/renderer_d3d9.cc b/o3d/core/win/d3d9/renderer_d3d9.cc index fe36184..c0a56af 100644 --- a/o3d/core/win/d3d9/renderer_d3d9.cc +++ b/o3d/core/win/d3d9/renderer_d3d9.cc @@ -890,10 +890,14 @@ RendererD3D9::RendererD3D9(ServiceLocator* service_locator) current_d3d_surface_(NULL), current_d3d_depth_surface_(NULL), have_device_(false), - fullscreen_(false), + fullscreen_(false) +#ifdef O3D_PLUGIN_ENABLE_FULLSCREEN_MSG + , fullscreen_message_font_(NULL), fullscreen_message_line_(NULL), - showing_fullscreen_message_(false) { + showing_fullscreen_message_(false) +#endif +{ // Setup state handlers AddStateHandler(State::kAlphaTestEnableParamName, new StateEnableHandler<D3DRS_ALPHATESTENABLE>); @@ -1037,6 +1041,7 @@ Renderer::InitStatus RendererD3D9::InitPlatformSpecific( } } +#ifdef O3D_PLUGIN_ENABLE_FULLSCREEN_MSG if (S_OK != D3DXCreateFont(d3d_device_, 27 /* font_height */, @@ -1060,6 +1065,7 @@ Renderer::InitStatus RendererD3D9::InitPlatformSpecific( DLOG(ERROR) << "Failed to initialize line for message background."; return INITIALIZATION_ERROR; } +#endif return SUCCESS; } @@ -1173,6 +1179,7 @@ bool RendererD3D9::InvalidateDeviceObjects() { } } +#ifdef O3D_PLUGIN_ENABLE_FULLSCREEN_MSG if (fullscreen_message_font_ && S_OK != fullscreen_message_font_->OnLostDevice()) { return false; @@ -1181,6 +1188,8 @@ bool RendererD3D9::InvalidateDeviceObjects() { S_OK != fullscreen_message_line_->OnLostDevice()) { return false; } +#endif + return true; } @@ -1238,6 +1247,8 @@ bool RendererD3D9::RestoreDeviceObjects() { } } } + +#ifdef O3D_PLUGIN_ENABLE_FULLSCREEN_MSG if (fullscreen_message_font_ && S_OK != fullscreen_message_font_->OnResetDevice()) { return false; @@ -1246,6 +1257,7 @@ bool RendererD3D9::RestoreDeviceObjects() { S_OK != fullscreen_message_line_->OnResetDevice()) { return false; } +#endif return true; } @@ -1412,8 +1424,10 @@ bool RendererD3D9::GoFullscreen(const DisplayWindow& display, windowed = false; } +#ifdef O3D_PLUGIN_ENABLE_FULLSCREEN_MSG showing_fullscreen_message_ = true; fullscreen_message_timer_.GetElapsedTimeAndReset(); // Reset the timer. +#endif d3d_present_parameters_.FullScreen_RefreshRateInHz = refresh_rate; d3d_present_parameters_.hDeviceWindow = window; @@ -1440,7 +1454,9 @@ bool RendererD3D9::CancelFullscreen(const DisplayWindow& display, const DisplayWindowWindows& platform_display = static_cast<const DisplayWindowWindows&>(display); HWND window = platform_display.hwnd(); +#ifdef O3D_PLUGIN_ENABLE_FULLSCREEN_MSG showing_fullscreen_message_ = false; +#endif d3d_present_parameters_.FullScreen_RefreshRateInHz = 0; d3d_present_parameters_.hDeviceWindow = window; d3d_present_parameters_.Windowed = true; @@ -1511,6 +1527,7 @@ void RendererD3D9::PlatformSpecificFinishRendering() { back_buffer_surface_ = NULL; back_buffer_depth_surface_ = NULL; +#ifdef O3D_PLUGIN_ENABLE_FULLSCREEN_MSG if (showing_fullscreen_message_) { // Message should display for 3 seconds after transition to fullscreen. float elapsed_time = @@ -1525,6 +1542,7 @@ void RendererD3D9::PlatformSpecificFinishRendering() { } } } +#endif } } @@ -1541,6 +1559,7 @@ void RendererD3D9::PlatformSpecificPresent() { void RendererD3D9::ApplyDirtyStates() { } +#ifdef O3D_PLUGIN_ENABLE_FULLSCREEN_MSG // TODO(gman): Why is this code in here? Shouldn't this use O3D to render this // instead of D3D? void RendererD3D9::ShowFullscreenMessage(float elapsed_time, @@ -1599,6 +1618,7 @@ void RendererD3D9::ShowFullscreenMessage(float elapsed_time, d3d_device_->SetRenderState(D3DRS_ZENABLE, z_enable); } +#endif void RendererD3D9::SetRenderSurfacesPlatformSpecific( const RenderSurface* surface, diff --git a/o3d/core/win/d3d9/renderer_d3d9.h b/o3d/core/win/d3d9/renderer_d3d9.h index cd62c5c..6fe3225 100644 --- a/o3d/core/win/d3d9/renderer_d3d9.h +++ b/o3d/core/win/d3d9/renderer_d3d9.h @@ -242,12 +242,14 @@ class RendererD3D9 : public Renderer { // Indicates we're rendering fullscreen rather than in the plugin region. bool fullscreen_; +#ifdef O3D_PLUGIN_ENABLE_FULLSCREEN_MSG // Indicates we're showing the "Press Escape..." banner. bool showing_fullscreen_message_; // We want to show the message for about 3 seconds. ElapsedTimeTimer fullscreen_message_timer_; // Draws the actual message. void ShowFullscreenMessage(float elapsedTime, float display_duration); +#endif // Invalidates all resources which are in D3DPOOL_DEFAULT. // Used before we try to reset the device, when the device is lost. @@ -269,10 +271,12 @@ class RendererD3D9 : public Renderer { // Returns true on success. bool ResetDevice(); +#ifdef O3D_PLUGIN_ENABLE_FULLSCREEN_MSG // The font to use to display the message when we go to fullscreen. CComPtr<ID3DXFont> fullscreen_message_font_; // The line used to draw the background for the message. CComPtr<ID3DXLine> fullscreen_message_line_; +#endif }; } // namespace o3d |