Revision: 6549 Author: j...@google.com Date: Thu Oct 29 15:48:15 2009 Log: Add tab identity support in Firefox.
http://code.google.com/p/google-web-toolkit/source/detail?r=6549 Modified: /changes/jat/single-xpi/plugins/xpcom/ExternalWrapper.cpp ======================================= --- /changes/jat/single-xpi/plugins/xpcom/ExternalWrapper.cpp Thu Oct 29 08:49:04 2009 +++ /changes/jat/single-xpi/plugins/xpcom/ExternalWrapper.cpp Thu Oct 29 15:48:15 2009 @@ -215,18 +215,16 @@ if (!windowWatcher) { return returnVal; } - nsCOMPtr<nsPIDOMWindow> innerWin = do_QueryInterface(topWindow); - nsCOMPtr<nsPIDOMWindow> outerWin = innerWin->GetOuterWindow(); - nsCOMPtr<nsIWebBrowserChrome> chrome; - if (windowWatcher->GetChromeForWindow(outerWin.get(), - getter_AddRefs(chrome)) != NS_OK) { - Debug::log(Debug::Warning) << "Unable to get browser chrome for window" - << Debug::flush; + // The nsPIDOMWindow interface of our top-level window appears to be stable + // across refreshes, so we will use that for our tab ID. + nsCOMPtr<nsPIDOMWindow> privateWin = do_QueryInterface(topWindow); + if (!privateWin) { return returnVal; } - Debug::log(Debug::Debugging) << "computeTabIdentity: browserChrome = " - << (void*) chrome.get() << Debug::flush; - // TODO(jat): find a way to get the tab from the chrome window + char buf[20]; // typically 8-16 hex digits plus 0x, not horrible if truncated + snprintf(buf, sizeof(buf), "%p", privateWin.get()); + buf[19] = 0; // ensure null termination + returnVal = buf; return returnVal; } --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---