diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-08 01:55:52 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-08 01:55:52 +0000 |
commit | c32a97f251e5d951e86d25815d989d4db2d59bdb (patch) | |
tree | 2d4384c2163a46e4c68d9ec0e6ede5dadcb14b33 /chrome/renderer | |
parent | 9ad566288f5f4972570cd52cf6258d2ab0fe5090 (diff) | |
download | chromium_src-c32a97f251e5d951e86d25815d989d4db2d59bdb.zip chromium_src-c32a97f251e5d951e86d25815d989d4db2d59bdb.tar.gz chromium_src-c32a97f251e5d951e86d25815d989d4db2d59bdb.tar.bz2 |
Clarify/fix fullscreen semantics, and add GetScreenSize
BUG=none
TEST=youtube, nba, amazon
Review URL: http://codereview.chromium.org/6625034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/pepper_plugin_delegate_impl.cc | 6 | ||||
-rw-r--r-- | chrome/renderer/pepper_plugin_delegate_impl.h | 1 | ||||
-rw-r--r-- | chrome/renderer/render_widget_fullscreen_pepper.cc | 18 |
3 files changed, 11 insertions, 14 deletions
diff --git a/chrome/renderer/pepper_plugin_delegate_impl.cc b/chrome/renderer/pepper_plugin_delegate_impl.cc index 8d11b2f..469bac6 100644 --- a/chrome/renderer/pepper_plugin_delegate_impl.cc +++ b/chrome/renderer/pepper_plugin_delegate_impl.cc @@ -40,6 +40,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserCompletion.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/size.h" @@ -867,6 +868,11 @@ PepperPluginDelegateImpl::CreateFullscreenContainer( return render_view_->CreatePepperFullscreenContainer(instance); } +gfx::Size PepperPluginDelegateImpl::GetScreenSize() { + WebKit::WebScreenInfo info = render_view_->screenInfo(); + return gfx::Size(info.rect.width, info.rect.height); +} + std::string PepperPluginDelegateImpl::GetDefaultEncoding() { // TODO(brettw) bug 56615: Somehow get the preference for the default // encoding here rather than using the global default for the UI language. diff --git a/chrome/renderer/pepper_plugin_delegate_impl.h b/chrome/renderer/pepper_plugin_delegate_impl.h index ab1193f..627d449 100644 --- a/chrome/renderer/pepper_plugin_delegate_impl.h +++ b/chrome/renderer/pepper_plugin_delegate_impl.h @@ -167,6 +167,7 @@ class PepperPluginDelegateImpl virtual webkit::ppapi::FullscreenContainer* CreateFullscreenContainer( webkit::ppapi::PluginInstance* instance); + virtual gfx::Size GetScreenSize(); virtual std::string GetDefaultEncoding(); virtual void ZoomLimitsChanged(double minimum_factor, double maximum_factor); virtual std::string ResolveProxy(const GURL& url); diff --git a/chrome/renderer/render_widget_fullscreen_pepper.cc b/chrome/renderer/render_widget_fullscreen_pepper.cc index 27b48cd4..7e5101a 100644 --- a/chrome/renderer/render_widget_fullscreen_pepper.cc +++ b/chrome/renderer/render_widget_fullscreen_pepper.cc @@ -63,8 +63,6 @@ class PepperWidget : public WebWidget { } virtual void paint(WebCanvas* canvas, const WebRect& rect) { - if (!plugin_) - return; WebRect plugin_rect(0, 0, size_.width, size_.height); plugin_->Paint(canvas, plugin_rect, rect); } @@ -84,8 +82,6 @@ class PepperWidget : public WebWidget { } virtual bool handleInputEvent(const WebInputEvent& event) { - if (!plugin_) - return false; return plugin_->HandleInputEvent(event, &cursor_); } @@ -97,46 +93,40 @@ class PepperWidget : public WebWidget { NOTIMPLEMENTED(); } + // TODO(piman): figure out IME and implement these if necessary. virtual bool setComposition( const WebString& text, const WebVector<WebCompositionUnderline>& underlines, int selectionStart, int selectionEnd) { - NOTIMPLEMENTED(); return false; } virtual bool confirmComposition() { - NOTIMPLEMENTED(); return false; } virtual bool confirmComposition(const WebString& text) { - NOTIMPLEMENTED(); return false; } virtual WebTextInputType textInputType() { - NOTIMPLEMENTED(); return WebKit::WebTextInputTypeNone; } virtual WebRect caretOrSelectionBounds() { - NOTIMPLEMENTED(); return WebRect(); } virtual void setTextDirection(WebTextDirection) { - NOTIMPLEMENTED(); } virtual bool isAcceleratedCompositingActive() const { - return widget_->context() && plugin_ && - (plugin_->GetBackingTextureId() != 0); + return widget_->context() && (plugin_->GetBackingTextureId() != 0); } private: - webkit::ppapi::PluginInstance* plugin_; + scoped_refptr<webkit::ppapi::PluginInstance> plugin_; RenderWidgetFullscreenPepper* widget_; WebSize size_; WebCursorInfo cursor_; @@ -223,7 +213,7 @@ void RenderWidgetFullscreenPepper::Close() { // If the fullscreen window is closed (e.g. user pressed escape), reset to // normal mode. if (plugin_) - plugin_->SetFullscreen(false); + plugin_->SetFullscreen(false, false); } webkit::ppapi::PluginInstance* |