diff options
author | ericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 02:43:24 +0000 |
---|---|---|
committer | ericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 02:43:24 +0000 |
commit | 50b8ee61c46bced3866f2646f37cbf9879d07027 (patch) | |
tree | 29a716cb570352a82dee3a0585fb02d0c5c1b4c3 /o3d/plugin/cross | |
parent | 279456e2046383387f27c48cb003efa28d5e5f32 (diff) | |
download | chromium_src-50b8ee61c46bced3866f2646f37cbf9879d07027.zip chromium_src-50b8ee61c46bced3866f2646f37cbf9879d07027.tar.gz chromium_src-50b8ee61c46bced3866f2646f37cbf9879d07027.tar.bz2 |
Polish full-screen mode a bit:
* Add a just-use-the-current-display-mode flag.
* Make the sample use more parts of the API.
* Correct the spelling of full-screen as per Google's policy.
* Check for valid mode when the user gives it to us.
* Expose clearFullscreenClickRegion to JS.
* Fix a typo in convolution while I'm in there.
Review URL: http://codereview.chromium.org/126034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18477 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin/cross')
-rw-r--r-- | o3d/plugin/cross/o3d_glue.cc | 16 | ||||
-rw-r--r-- | o3d/plugin/cross/o3d_glue.h | 12 |
2 files changed, 19 insertions, 9 deletions
diff --git a/o3d/plugin/cross/o3d_glue.cc b/o3d/plugin/cross/o3d_glue.cc index f760e1b..e14bb00 100644 --- a/o3d/plugin/cross/o3d_glue.cc +++ b/o3d/plugin/cross/o3d_glue.cc @@ -669,6 +669,22 @@ int PluginObject::height() const { return 0; } +bool PluginObject::SetFullscreenClickRegion(int x, int y, int width, int height, + int mode_id) { + bool success = false; + o3d::DisplayMode mode; + // Make sure it's a valid ID first. + if (renderer()->GetDisplayMode(mode_id, &mode)) { + fullscreen_region_valid_ = true; + fullscreen_region_x_ = x; + fullscreen_region_y_ = y; + fullscreen_region_width_ = width; + fullscreen_region_height_ = height; + fullscreen_region_mode_id_ = mode_id; + success = true; + } + return success; +} // On Mac there is a different implementation in plugin_mac.mm. #ifndef OS_MACOSX diff --git a/o3d/plugin/cross/o3d_glue.h b/o3d/plugin/cross/o3d_glue.h index ebe2a44..1b49e02 100644 --- a/o3d/plugin/cross/o3d_glue.h +++ b/o3d/plugin/cross/o3d_glue.h @@ -306,15 +306,9 @@ class PluginObject: public NPObject { // user, as this region has no visible marker. The user is also responsible // for updating this region if the plugin gets resized, as we don't know // whether or how to scale it. - void SetFullscreenClickRegion(int x, int y, int width, int height, - int mode_id) { - fullscreen_region_valid_ = true; - fullscreen_region_x_ = x; - fullscreen_region_y_ = y; - fullscreen_region_width_ = width; - fullscreen_region_height_ = height; - fullscreen_region_mode_id_ = mode_id; - } + // Fails if the mode_id supplied isn't valid. Returns true on success. + bool SetFullscreenClickRegion(int x, int y, int width, int height, + int mode_id); void ClearFullscreenClickRegion() { fullscreen_region_valid_ = false; } |