зеркало из https://github.com/mozilla/gecko-dev.git
Bug 246695 Gtk Embedding widget ignore scrollbar chrome setting
r=bryner sr=blizzard patch by Crispin Flowerday <crispin@flowerday.cx>
This commit is contained in:
Родитель
f5ffb0eb06
Коммит
70ab852e63
|
@ -61,6 +61,9 @@
|
|||
#include <nsIDOMWindowInternal.h>
|
||||
#include <nsIChromeEventHandler.h>
|
||||
|
||||
// For seting scrollbar visibilty
|
||||
#include <nsIDOMBarProp.h>
|
||||
|
||||
// for the focus hacking we need to do
|
||||
#include <nsIFocusController.h>
|
||||
|
||||
|
@ -145,7 +148,7 @@ EmbedPrivate::EmbedPrivate(void)
|
|||
mContentListener = nsnull;
|
||||
mEventListener = nsnull;
|
||||
mStream = nsnull;
|
||||
mChromeMask = 0;
|
||||
mChromeMask = nsIWebBrowserChrome::CHROME_ALL;
|
||||
mIsChrome = PR_FALSE;
|
||||
mChromeLoaded = PR_FALSE;
|
||||
mListenersAttached = PR_FALSE;
|
||||
|
@ -286,6 +289,9 @@ EmbedPrivate::Realize(PRBool *aAlreadyRealized)
|
|||
gdk_window_get_user_data(tmp_window, &data);
|
||||
mMozWindowWidget = NS_STATIC_CAST(GtkWidget *, data);
|
||||
|
||||
// Apply the current chrome mask
|
||||
ApplyChromeMask();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -403,6 +409,39 @@ EmbedPrivate::LoadCurrentURI(void)
|
|||
nsnull); // extra headers
|
||||
}
|
||||
|
||||
void
|
||||
EmbedPrivate::ApplyChromeMask()
|
||||
{
|
||||
if (mWindow) {
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser;
|
||||
mWindow->GetWebBrowser(getter_AddRefs(webBrowser));
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> domWindow;
|
||||
webBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
|
||||
if (domWindow) {
|
||||
|
||||
nsCOMPtr<nsIDOMBarProp> scrollbars;
|
||||
domWindow->GetScrollbars(getter_AddRefs(scrollbars));
|
||||
if (scrollbars) {
|
||||
|
||||
scrollbars->SetVisible
|
||||
(mChromeMask & nsIWebBrowserChrome::CHROME_SCROLLBARS ?
|
||||
PR_TRUE : PR_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
EmbedPrivate::SetChromeMask (PRUint32 aChromeMask)
|
||||
{
|
||||
mChromeMask = aChromeMask;
|
||||
|
||||
ApplyChromeMask();
|
||||
}
|
||||
|
||||
|
||||
/* static */
|
||||
void
|
||||
EmbedPrivate::PushStartup(void)
|
||||
|
|
|
@ -83,6 +83,9 @@ class EmbedPrivate {
|
|||
void SetURI (const char *aURI);
|
||||
void LoadCurrentURI (void);
|
||||
|
||||
void SetChromeMask (PRUint32 chromeMask);
|
||||
void ApplyChromeMask ();
|
||||
|
||||
static void PushStartup (void);
|
||||
static void PopStartup (void);
|
||||
static void SetCompPath (const char *aPath);
|
||||
|
|
|
@ -181,7 +181,7 @@ EmbedWindow::GetChromeFlags(PRUint32 *aChromeFlags)
|
|||
NS_IMETHODIMP
|
||||
EmbedWindow::SetChromeFlags(PRUint32 aChromeFlags)
|
||||
{
|
||||
mOwner->mChromeMask = aChromeFlags;
|
||||
mOwner->SetChromeMask(aChromeFlags);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1164,7 +1164,7 @@ gtk_moz_embed_set_chrome_mask(GtkMozEmbed *embed, guint32 flags)
|
|||
|
||||
embedPrivate = (EmbedPrivate *)embed->data;
|
||||
|
||||
embedPrivate->mChromeMask = flags;
|
||||
embedPrivate->SetChromeMask(flags);
|
||||
}
|
||||
|
||||
guint32
|
||||
|
|
Загрузка…
Ссылка в новой задаче