本文整理汇总了C++中Window::GetCurrentDoc方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::GetCurrentDoc方法的具体用法?C++ Window::GetCurrentDoc怎么用?C++ Window::GetCurrentDoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window::GetCurrentDoc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/* static */ int
DOM_BrowserTab::getScreenshot(DOM_Object* this_object, ES_Value* argv, int argc, ES_Value* return_value, DOM_Runtime* origining_runtime)
{
DOM_THIS_OBJECT(tab, DOM_TYPE_BROWSER_TAB, DOM_BrowserTab);
Window* window = tab->GetTabWindow();
FramesDocument* target = window ? window->GetCurrentDoc() : NULL;
OP_ASSERT(tab->m_extension_support->GetBackground());
return tab->m_extension_support->GetScreenshot(target, argv, argc, return_value, origining_runtime);
}
示例2: GetTabInfo
/* virtual */ ES_GetState
DOM_BrowserTab::GetName(OpAtom property_name, ES_Value* value, ES_Runtime* origining_runtime)
{
switch (property_name)
{
case OP_ATOM_id:
DOMSetNumber(value, GetTabId());
return GET_SUCCESS;
case OP_ATOM_locked:
case OP_ATOM_browserWindow:
case OP_ATOM_position:
case OP_ATOM_tabGroup:
case OP_ATOM_focused:
case OP_ATOM_selected:
case OP_ATOM_title:
case OP_ATOM_private:
case OP_ATOM_closed:
return GetTabInfo(property_name, value, origining_runtime, NULL);
case OP_ATOM_faviconUrl:
{
#ifdef SHORTCUT_ICON_SUPPORT
Window* window = GetTabWindow();
if (window && (!window->GetPrivacyMode() || IsPrivateDataAllowed()))
DOMSetString(value, window->GetWindowIconURL().GetAttribute(URL::KUniName_With_Fragment, URL::KNoRedirect).CStr());
#endif // SHORTCUT_ICON_SUPPORT
return GET_SUCCESS;
}
case OP_ATOM_url:
{
Window* window = GetTabWindow();
if (window && (!window->GetPrivacyMode() || IsPrivateDataAllowed()))
{
const uni_char* url = window->GetCurrentURL().GetAttribute(URL::KUniName_With_Fragment, URL::KNoRedirect).CStr();
if (!url || !*url) // if nothing is currently loaded then try if something is loading.
url = window->GetCurrentLoadingURL().GetAttribute(URL::KUniName_With_Fragment, URL::KNoRedirect).CStr();
DOMSetString(value, url);
}
return GET_SUCCESS;
}
case OP_ATOM_readyState:
{
Window* window = GetTabWindow();
if (window && (!window->GetPrivacyMode() || IsPrivateDataAllowed()))
DOM_Document::GetDocumentReadiness(value, window->GetCurrentDoc());
return GET_SUCCESS;
}
#ifdef USE_SPDY
case OP_ATOM_loadedWithSPDY:
{
Window* window = GetTabWindow();
if (window && (!window->GetPrivacyMode() || IsPrivateDataAllowed()))
DOMSetBoolean(value, window->GetCurrentURL().GetAttribute(URL::KLoadedWithSpdy));
return GET_SUCCESS;
}
#endif // USE_SPDY
case OP_ATOM_port:
DOMSetObject(value, GetPort());
return GET_SUCCESS;
default:
return DOM_Object::GetName(property_name, value, origining_runtime);
}
}