本文整理汇总了C++中Browser::GetTabContentsWrapperAt方法的典型用法代码示例。如果您正苦于以下问题:C++ Browser::GetTabContentsWrapperAt方法的具体用法?C++ Browser::GetTabContentsWrapperAt怎么用?C++ Browser::GetTabContentsWrapperAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browser
的用法示例。
在下文中一共展示了Browser::GetTabContentsWrapperAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CloseAllBrowsers
// static
void BrowserList::CloseAllBrowsers()
{
bool session_ending =
browser_shutdown::GetShutdownType() == browser_shutdown::END_SESSION;
bool force_exit = false;
// Tell everyone that we are shutting down.
browser_shutdown::SetTryingToQuit(true);
// Before we close the browsers shutdown all session services. That way an
// exit can restore all browsers open before exiting.
//ProfileManager::ShutdownSessionServices();
// If there are no browsers, send the APP_TERMINATING action here. Otherwise,
// it will be sent by RemoveBrowser() when the last browser has closed.
if(force_exit || browsers_.empty())
{
NotifyAndTerminate(true);
return;
}
for(BrowserList::const_iterator i=BrowserList::begin();
i!=BrowserList::end();)
{
Browser* browser = *i;
browser->window()->Close();
if(!session_ending)
{
++i;
}
else
{
// This path is hit during logoff/power-down. In this case we won't get
// a final message and so we force the browser to be deleted.
// Close doesn't immediately destroy the browser
// (Browser::TabStripEmpty() uses invoke later) but when we're ending the
// session we need to make sure the browser is destroyed now. So, invoke
// DestroyBrowser to make sure the browser is deleted and cleanup can
// happen.
while(browser->tab_count())
{
delete browser->GetTabContentsWrapperAt(0);
}
browser->window()->DestroyBrowser();
i = BrowserList::begin();
if(i!=BrowserList::end() && browser==*i)
{
// Destroying the browser should have removed it from the browser list.
// We should never get here.
NOTREACHED();
return;
}
}
}
}