当前位置: 首页>>代码示例>>C++>>正文


C++ Browser::tab_count方法代码示例

本文整理汇总了C++中Browser::tab_count方法的典型用法代码示例。如果您正苦于以下问题:C++ Browser::tab_count方法的具体用法?C++ Browser::tab_count怎么用?C++ Browser::tab_count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Browser的用法示例。


在下文中一共展示了Browser::tab_count方法的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;
            }
        }
    }
}
开发者ID:noodle1983,项目名称:putty-nd3.x,代码行数:54,代码来源:browser_list.cpp


注:本文中的Browser::tab_count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。