nsIWebBrowserChrome 编辑

embedding/browser/webBrowser/nsIWebBrowserChrome.idlScriptable Corresponds to the top-level, outermost window containing an embedded Gecko web browser. Inherits from: nsISupports Last changed in Gecko 0.9.6

Method overview

void destroyBrowserWindow();
void exitModalEventLoop(in nsresult aStatus);
boolean isWindowModal();
void setStatus(in unsigned long statusType, in wstring status);
void showAsModal();
void sizeBrowserTo(in long aCX, in long aCY);

Attributes

AttributeTypeDescription
chromeFlagsunsigned longThe chrome flags for this browser chrome. The implementation should reflect the value of this attribute by hiding or showing its chrome appropriately.
webBrowsernsIWebBrowserThe currently loaded WebBrowser. The browser chrome may be told to set the WebBrowser object to a new object by setting this attribute. In this case the implementer is responsible for taking the new WebBrowser object and doing any necessary initialization or setup as if it had created the WebBrowser itself. This includes positioning setting up listeners etc.

Constants

ConstantValueDescription
STATUS_SCRIPT1Flag for SetStatus()
STATUS_SCRIPT_DEFAULT2Flag for SetStatus()
STATUS_LINK3Flag for SetStatus()
CHROME_DEFAULT1Value for the chromeFlags attribute.
CHROME_WINDOW_BORDERS2Value for the chromeFlags attribute.
CHROME_WINDOW_CLOSE4Value for the chromeFlags attribute.
CHROME_WINDOW_RESIZE8Value for the chromeFlags attribute.
CHROME_MENUBAR16Value for the chromeFlags attribute.
CHROME_TOOLBAR32Value for the chromeFlags attribute.
CHROME_LOCATIONBAR64Value for the chromeFlags attribute.
CHROME_STATUSBAR128Value for the chromeFlags attribute.
CHROME_PERSONAL_TOOLBAR256Value for the chromeFlags attribute.
CHROME_SCROLLBARS512Value for the chromeFlags attribute.
CHROME_TITLEBAR1024Value for the chromeFlags attribute.
CHROME_EXTRA2048Value for the chromeFlags attribute.
CHROME_WITH_SIZE4096Specifically for use with nsIWindowCreator.
CHROME_WITH_POSITION8192Specifically for use with nsIWindowCreator.
CHROME_WINDOW_MIN16384Represent special cases.
CHROME_WINDOW_POPUP32768Represent special cases.
CHROME_WINDOW_RAISED33554432Represent special cases.
CHROME_WINDOW_LOWERED67108864Represent special cases.
CHROME_CENTER_SCREEN134217728Represent special cases.
CHROME_DEPENDENT268435456Make the new window dependent on the parent. This flag is only meaningful if CHROME_OPENAS_CHROME is set; content windows should not be dependent.
CHROME_MODAL536870912The modal style bit just affects the way the window looks and does not mean it's actually modal.
CHROME_OPENAS_DIALOG1073741824Represent special cases.
CHROME_OPENAS_CHROME2147483648Represent special cases.
CHROME_ALL4094Represent special cases.
CHROME_REMOTE_WINDOW1048576Whether this window should use remote (out-of-process) tabs.

Methods

destroyBrowserWindow()

Asks the implementer to destroy the window associated with this WebBrowser object.

void destroyBrowserWindow();
Parameters

None.

exitModalEventLoop()

Exit a modal event loop if we're in one. The implementation should also exit out of the loop if the window is destroyed.

void exitModalEventLoop(
  in nsresult aStatus
);
Parameters
aStatus
The result code to return from showAsModal().

isWindowModal()

Is the window modal (that is, currently executing a modal loop)?

boolean isWindowModal();
Parameters

None.

Return value

true if it's a modal window.

setStatus()

Called when the status text in the chrome needs to be updated.

void setStatus(
  in unsigned long statusType,
  in wstring status
);
Parameters
statusType
Indicates what is setting the text.
status
Status string. null is an acceptable value meaning no status.

showAsModal()

Shows the window as a modal window.

void showAsModal();
Parameters

None.

Return Value
Note: The function error code returned by this corresponds to the status value specified in exitModalEventLoop.

sizeBrowserTo()

Tells the chrome to size itself such that the browser will be the specified size.

void sizeBrowserTo(
  in long aCX,
  in long aCY
);
Parameters
aCX
New width of the browser.
aCY
New height of the browser.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:88 次

字数:10384

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文