diff options
author | maf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 23:33:21 +0000 |
---|---|---|
committer | maf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 23:33:21 +0000 |
commit | f44ea0d6f8a6da9b98ecfe3fc30235ef65e28635 (patch) | |
tree | 438d764fb3ab89a93ee91d3764c053abf701ade0 /o3d/plugin/mac/main_mac.mm | |
parent | 26cd5c815ddc94fe643cb7acf23731d2a2d80915 (diff) | |
download | chromium_src-f44ea0d6f8a6da9b98ecfe3fc30235ef65e28635.zip chromium_src-f44ea0d6f8a6da9b98ecfe3fc30235ef65e28635.tar.gz chromium_src-f44ea0d6f8a6da9b98ecfe3fc30235ef65e28635.tar.bz2 |
Add a boolean parameter to Client::RenderClient() to choose whether to
make the javascript render callback or not.
Generally you want to pass true, but if the render is happening
in non-windowed mode (eg on a Mac) and is in response to an update
event rather than a timer, it can be useful to pass false to prevent
the javascript code triggering another update and causing an infinite
calback loop. Case in point is the custom camera example, which
modifies some HTML form text fields on render callback, which on
Firefox causes a plugin invalidation and round and round we would go.
Review URL: http://codereview.chromium.org/159181
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21473 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin/mac/main_mac.mm')
-rw-r--r-- | o3d/plugin/mac/main_mac.mm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/o3d/plugin/mac/main_mac.mm b/o3d/plugin/mac/main_mac.mm index 1ef1d1c..11355b7 100644 --- a/o3d/plugin/mac/main_mac.mm +++ b/o3d/plugin/mac/main_mac.mm @@ -73,8 +73,8 @@ scoped_ptr<base::AtExitManager> g_at_exit_manager; #define CFTIMER // #define DEFERRED_DRAW_ON_NULLEVENTS -void DrawPlugin(PluginObject* obj) { - obj->client()->RenderClient(); +void DrawPlugin(PluginObject* obj, bool send_callback) { + obj->client()->RenderClient(send_callback); } unsigned char GetMacEventKeyChar(const EventRecord *the_event) { @@ -411,7 +411,7 @@ bool HandleCocoaEvent(NPP instance, NPCocoaEvent* the_event) { obj->MacEventReceived(); switch (the_event->type) { case NPCocoaEventDrawRect: - DrawPlugin(obj); + DrawPlugin(obj, false); handled = true; break; case NPCocoaEventMouseDown: @@ -729,7 +729,7 @@ bool HandleMacEvent(EventRecord* the_event, NPP instance) { GLUE_PROFILE_STOP(instance, "forceredraw"); #elif defined(CFTIMER) #else - DrawPlugin(obj); + DrawPlugin(obj, true); #endif // Safari tab switching recovery code. if (obj->mac_surface_hidden_) { @@ -754,7 +754,7 @@ bool HandleMacEvent(EventRecord* the_event, NPP instance) { handled = true; break; case updateEvt: - DrawPlugin(obj); + DrawPlugin(obj, false); handled = true; break; case osEvt: |