diff options
author | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-18 00:02:58 +0000 |
---|---|---|
committer | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-18 00:02:58 +0000 |
commit | 18db963356e69ccff7efe539aa4744b84a7e34ba (patch) | |
tree | d33e6a8654e2b7347e94be68c2d616e1fd18ecb5 /chrome_frame/chrome_frame_npapi.cc | |
parent | bdd56f722aab4b8c9be19fad8b9bc88175553c4e (diff) | |
download | chromium_src-18db963356e69ccff7efe539aa4744b84a7e34ba.zip chromium_src-18db963356e69ccff7efe539aa4744b84a7e34ba.tar.gz chromium_src-18db963356e69ccff7efe539aa4744b84a7e34ba.tar.bz2 |
Change the FF CEEE to create its chrome frame instance initially hidden, and
make it visible only once the content is done loading. This avoids any flicker
at startup, and fixes a bug where the chrome frame instance is removed after
a print preview.
Also added support to chrome frame to send an uninitialized ready state
when its being torn down. Did some cleanup in the chrome frame tests which
were broke the first time this change was committed.
BUG=62979
TEST=Make sure that there is no UI flicker on chrome frame startup, and make
sure that the extenions works correct after showing print preview and closing
it.
Review URL: http://codereview.chromium.org/5022003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66552 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_npapi.cc')
-rw-r--r-- | chrome_frame/chrome_frame_npapi.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome_frame/chrome_frame_npapi.cc b/chrome_frame/chrome_frame_npapi.cc index ea7217f..f3144b1 100644 --- a/chrome_frame/chrome_frame_npapi.cc +++ b/chrome_frame/chrome_frame_npapi.cc @@ -290,9 +290,8 @@ bool ChromeFrameNPAPI::Initialize(NPMIMEType mime_type, NPP instance, } void ChromeFrameNPAPI::Uninitialize() { - // Don't call SetReadyState as it will end up calling FireEvent. - // We are in the context of NPP_DESTROY. - ready_state_ = READYSTATE_UNINITIALIZED; + if (ready_state_ != READYSTATE_UNINITIALIZED) + SetReadyState(READYSTATE_UNINITIALIZED); UnsubscribeFromFocusEvents(); @@ -851,7 +850,7 @@ void ChromeFrameNPAPI::OnMessageFromChromeFrame(int tab_handle, } DLOG_IF(WARNING, !invoke) << "InvokeDefault failed"; } else { - NOTREACHED() << "CreateMessageEvent"; + DLOG(WARNING) << "CreateMessageEvent failed, probably exiting"; } } @@ -1055,7 +1054,7 @@ void ChromeFrameNPAPI::DispatchEvent(NPObject* event) { npapi::GetStringIdentifier("dispatchEvent"), ¶m, 1, &result); DLOG_IF(WARNING, !invoke) << "dispatchEvent failed"; } else { - NOTREACHED() << "NPNVPluginElementNPObject"; + DLOG(WARNING) << "ChromeFrameNPAPI::DispatchEvent failed, probably exiting"; } } @@ -1440,7 +1439,7 @@ NpProxyService* ChromeFrameNPAPI::CreatePrefService() { } NPObject* ChromeFrameNPAPI::GetWindowObject() const { - if (!window_object_.get()) { + if (!window_object_.get() && instance_) { NPError ret = npapi::GetValue(instance_, NPNVWindowNPObject, window_object_.Receive()); DLOG_IF(ERROR, ret != NPERR_NO_ERROR) << "NPNVWindowNPObject failed"; |