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


C++ Window::GetHistoryLen方法代码示例

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


在下文中一共展示了Window::GetHistoryLen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Execute


//.........这里部分代码省略.........
								{
									if (oldHandler && !keep_loading)
									{
										download_url.ChangeMessageHandler(oldHandler, g_main_message_handler);
										currentHandler = g_main_message_handler;
									}
									else
										currentHandler = oldHandler;	
								}
							}
						}
						// currentHandler is NULL when download_url.Status(FALSE) equals URL_LOADING_FAILED, or shall we set it to g_main_message_handler anyway?
						if (currentHandler)
							newitem->SetCallbacks(currentHandler, download_url.Id(TRUE));
					}
				}
				if (download_action_mode == DOWNLOAD_RUN)
				{
					if (	document_manager &&
							download_url.Status(FALSE) != URL_UNLOADED &&
							download_url.Status(TRUE) != URL_LOADING)
					{
						// The loading has already finished. We have to trigger the action
						// manually by using HandleAllLoaded() [espen]

						// InitiateTransfer() above destroys filename
						//				doc_man->SetCurrentURL(saved_url);

						if( viewer.GetAction() == VIEWER_APPLICATION || viewer.GetAction() == VIEWER_PASS_URL)
						{
							document_manager->SetAction(VIEWER_APPLICATION);
							document_manager->SetApplication(viewer.GetApplicationToOpenWith());
						}

						else if(viewer.GetAction() == VIEWER_REG_APPLICATION)
						{
							document_manager->SetAction(VIEWER_REG_APPLICATION);
						}
						// Restore
						//				doc_man->SetCurrentURL(GetUrl());
					}
				}
				if (dont_add_to_transfers)
				{
					if (download_context && download_context->GetTransferListener())
						download_context->GetTransferListener()->OnSavedFromCacheDone(download_filename);
				}
				done = TRUE;
				break;
			}

			// Here we clean up in the context of document manager
			if (document_manager && !keep_loading)
				document_manager->StopLoading(FALSE);	//the window is not handling the loading anymore

			if (document_manager && download_url.Status(TRUE) != URL_LOADING)
				document_manager->HandleAllLoaded(download_url.Id(TRUE));

			EnableWindowClose();
		}
		else
		{
#ifdef WEB_TURBO_MODE
			// Downloads should not use Turbo. NB! This WILL generate a second request for the same resource (this time without using the Turbo proxy)
			if (download_url.GetAttribute(URL::KUsesTurbo) &&
				!download_url.GetAttribute(URL::KTurboBypassed) &&
#ifdef _BITTORRENT_SUPPORT_
				download_url.ContentType() != URL_P2P_BITTORRENT &&
#endif // _BITTORRENT_SUPPORT_
				document_manager)
			{
				URLStatus ustat = (URLStatus)download_url.GetAttribute(URL::KLoadStatus, URL::KFollowRedirect);
				if (ustat == URL_LOADING)
					document_manager->StopLoading(FALSE);

				const OpStringC8 url_str = download_url.GetAttribute(URL::KName_With_Fragment_Username_Password_NOT_FOR_UI, URL::KNoRedirect);
				download_url = g_url_api->GetURL(url_str.CStr());
				document_manager->SetCurrentURL(download_url, TRUE);
			}
#endif // WEB_TURBO_MODE
			delayed = TRUE;
		}
	}
	if (done)
	{
		Window* win = document_manager ? document_manager->GetWindow():NULL;
		TryDelete();

		//if the window is Not intiated by the user and this is the first url the window loads, close it
		//since the data is handled elsewhere.
		if (win && win->GetOpenerWindow() && win->GetHistoryLen() == 0 && win->CanClose())
			win->Close();

		return OpBoolean::IS_TRUE; // Signifying that we have done a transition through a download initiation
	}
	else
	{
		return OpBoolean::IS_FALSE; // Signifying that we will back here before we are done
	}
}
开发者ID:prestocore,项目名称:browser,代码行数:101,代码来源:TransferManagerDownload.cpp


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