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


C++ WebURL类代码示例

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


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

示例1: TEST_F

TEST_F(WebPageSerializerTest, fromUrlWithMinusMinus)
{
    WebURL topFrameURL = toKURL("http://www.test.com?--x--");
    registerMockedURLLoad(topFrameURL.spec(), WebString::fromUTF8("text_only_page.html"));
    loadURLInTopFrame(topFrameURL);

    SimpleWebPageSerializerClient serializerClient;
    WebVector<WebURL> links(&topFrameURL, 1);
    WebVector<WebString> localPaths(&"local", 1);
    WebPageSerializer::serialize(webView()->mainFrame()->toWebLocalFrame(), &serializerClient, links, localPaths, "");

    EXPECT_EQ("<!-- saved from url=(0030)http://www.test.com/?-%2Dx-%2D -->", serializerClient.toString().substr(1, 60));
}
开发者ID:shaoboyan,项目名称:chromium-crosswalk,代码行数:13,代码来源:WebPageSerializerTest.cpp

示例2: showDevTools

void TestShell::showDevTools()
{
    if (!m_devTools) {
        WebURL url = webkit_support::GetDevToolsPathAsURL();
        if (!url.isValid()) {
            ASSERT(false);
            return;
        }
        m_devTools = createNewWindow(url);
        ASSERT(m_devTools);
        createDRTDevToolsClient(m_drtDevToolsAgent.get());
    }
    m_devTools->show(WebKit::WebNavigationPolicyNewWindow);
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例3: OnShowCreatedWebView

void ViewListener::OnShowCreatedWebView(WebView *caller, WebView *new_view, const WebURL &opener_url, const WebURL &target_url, const Rect &initial_pos, bool is_popup)
{
	DevMsg("ViewListener: OnShowCreatedWebView: %s\n", WebStringToCharString(target_url.spec()));
	//C_WebBrowser* pWebBrowser = g_pAnarchyManager->GetWebManager()->GetWebBrowser();
	//pWebBrowser->PrepareWebView(new_view);
	new_view->Destroy();
}
开发者ID:smsithlord,项目名称:AArcade-Source,代码行数:7,代码来源:c_awesomiumlisteners.cpp

示例4: loadURLForFrame

void WebViewHost::loadURLForFrame(const WebURL& url, const WebString& frameName)
{
    if (!url.isValid())
        return;
    TestShell::resizeWindowForTest(this, url);
    navigationController()->loadEntry(TestNavigationEntry::create(-1, url, WebString(), frameName).get());
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例5: willPerformClientRedirect

void WebViewHost::willPerformClientRedirect(WebFrame* frame, const WebURL& from, const WebURL& to,
                                            double interval, double fire_time)
{
    if (!m_shell->shouldDumpFrameLoadCallbacks())
        return;
    printFrameDescription(frame);
    printf(" - willPerformClientRedirectToURL: %s \n", to.spec().data());
}
开发者ID:mcgrawp,项目名称:webkit-webcl,代码行数:8,代码来源:WebViewHost.cpp

示例6: OnFinishLoadingFrame

// REGULAR
void LoadListener::OnFinishLoadingFrame(WebView* caller, int64 frame_id, bool is_main_frame, const WebURL& url)
{
	C_AwesomiumBrowserInstance* pHudBrowserInstance = g_pAnarchyManager->GetAwesomiumBrowserManager()->FindAwesomiumBrowserInstance("hud");
	std::string urlSpec = WebStringToCharString(url.spec());
	if (caller == pHudBrowserInstance->GetWebView() && !g_pAnarchyManager->IsInitialized() && urlSpec == "asset://ui/startup.html" )
	{
		g_pAnarchyManager->OnStartup();
		return;
	}
}
开发者ID:smsithlord,项目名称:AArcade-Source,代码行数:11,代码来源:c_awesomiumlisteners.cpp

示例7: OnDocumentReady

void LoadListener::OnDocumentReady(WebView* caller, const WebURL& url)
{
	//DevMsg("LoadListener: OnDocumentReady: %s\n", WebStringToCharString(url.spec()));

	//C_WebBrowser* pWebBrowser = g_pAnarchyManager->GetWebManager()->GetWebBrowser();

	std::string urlSpec = WebStringToCharString(url.spec());
	size_t foundPrefix = urlSpec.find("asset://newwindow/");
	if (foundPrefix == 0)
	{
		// extract a web tab id
		std::string id = urlSpec.substr(18);
		DevMsg("Sally: %s\n", urlSpec.c_str());

		//if (id == "hud" && g_pAnarchyManager->GetState() == AASTATE_AWESOMIUMBROWSERMANAGERHUDWAIT )// || bHudReady
		//	g_pAnarchyManager->GetAwesomiumBrowserManager()->OnHudWebViewDocumentReady(caller, id);
		//else
			g_pAnarchyManager->GetAwesomiumBrowserManager()->OnCreateWebViewDocumentReady(caller, id);
	}
	else
	{
		//DevMsg("hariy: %s\n", urlSpec.c_str());
		//g_pAnarchyManager->GetAwesomiumBrowserManager()->OnHudWebViewDocumentReady(caller, "hud");
	//	if (!g_pAnarchyManager->GetWebManager()->GetHudReady())
//			pWebBrowser->OnHudWebViewDocumentReady(caller, g_pAnarchyManager->GetWebManager()->GetHudWebTab()->GetId());





		//{
			//foundPrefix = urlSpec.find("asset://ui/loading.html");
			//if (foundPrefix == 0)
			//	pWebBrowser->OnHudWebViewDocumentReady(caller, g_pAnarchyManager->GetWebManager()->GetHudWebTab()->GetId());
			//foundPrefix = urlSpec.find("asset://ui/hud.html");
			//if (foundPrefix == 0)
				//pWebBrowser->OnHudWebViewDocumentReady(caller, g_pAnarchyManager->GetWebManager()->GetHudWebTab()->GetId());
			//else
		//	{
//				foundPrefix = urlSpec.find("asset://ui/loading.html");
//				if (foundPrefix == 0)
//					pWebBrowser->OnHudWebViewDocumentReady(caller, g_pAnarchyManager->GetWebManager()->GetHudWebTab()->GetId());
				//pWebBrowser->OnLoadingWebViewDocumentReady(caller, g_pAnarchyManager->GetWebManager()->GetHudWebTab()->GetId());
		//	}
		//}
		/*
		else
		{
			foundPrefix = urlSpec.find("asset://ui/loading.html");
			if ( foundPrefix == 0 )
				pWebBrowser->OnLoadingWebViewDocumentReady(caller, g_pAnarchyManager->GetWebManager()->GetHudWebTab()->GetId());
		}
		*/
	}
}
开发者ID:smsithlord,项目名称:AArcade-Source,代码行数:55,代码来源:c_awesomiumlisteners.cpp

示例8: chooseFiles

void WebOpenPanelResultListenerProxy::chooseFiles(ImmutableArray* fileURLsArray)
{
    if (!m_page)
        return;

    size_t size = fileURLsArray->size();

    Vector<String> filePaths;
    filePaths.reserveInitialCapacity(size);

    for (size_t i = 0; i < size; ++i) {
        WebURL* webURL = fileURLsArray->at<WebURL>(i);
        if (webURL) {
            KURL url(KURL(), webURL->string()); 
            filePaths.uncheckedAppend(url.fileSystemPath());
        }
    }

    m_page->didChooseFilesForOpenPanel(filePaths);
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:20,代码来源:WebOpenPanelResultListenerProxy.cpp

示例9: willPerformClientRedirect

void WebViewHost::willPerformClientRedirect(WebFrame* frame, const WebURL& from, const WebURL& to,
                                            double interval, double fire_time)
{
    if (m_shell->shouldDumpFrameLoadCallbacks()) {
        printFrameDescription(frame);
        printf(" - willPerformClientRedirectToURL: %s \n", to.spec().data());
    }

    if (m_shell->shouldDumpUserGestureInFrameLoadCallbacks())
        printFrameUserGestureStatus(frame, " - in willPerformClientRedirect\n");
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例10: verify

void verify(unordered_map<long,WebURL>& webURLs)
{
	unordered_map<long,WebURL>::iterator it;

	cout<<"\nVERIFYING THE UNORDERED MAP :"<<endl;
	cout<<"The size of unordered_map = "<<webURLs.size()<<endl;
	for(it = webURLs.begin(); it != webURLs.end(); it++)
	{
		cout<<"Web URL = "<<it->first<<":"<<endl;
		WebURL myurl = it->second;
		cout<<"id = "<<myurl.getId()<<"\t"<<"Page Rank = "<<setprecision(15)<<myurl.getNewPageRank()<<"\tOutbound WebURL ids : ";
		list<WebURL *> listofurls = myurl.getOutboundWebURLs();
		list<WebURL *>::iterator listite;
		for(listite = listofurls.begin(); listite != listofurls.end(); listite++)
		{
			WebURL *url = *listite;
			cout<<url->getId()<<" ";
		}
		cout<<endl<<endl;
	}
}
开发者ID:ldfaiztt,项目名称:MSCS,代码行数:21,代码来源:seqpagerank.cpp

示例11: initializeWebURLs

void initializeWebURLs(unordered_map<long,WebURL>& webURLs, long& totalURLs, string inputFile )
{
	double initialPageRankValue = (double)1/totalURLs;
	ifstream infile(inputFile,ios::in);
	string line, url;
	size_t pos;
	vector<long> urlArray;

	if(!infile.is_open())
	{
		string s = "Error : Cannot open the input file \"" + inputFile + "\"";
		throw s;
	}
	while(!infile.eof())
	{
		getline(infile,line);
		ltrim(line);
		rtrim(line);
		urlArray.clear();
		if(line.length() > 0)
		{
			pos = line.find(' ',0);
			if(pos > LARGEST_SIZE_T)
			{
				// It contains only the master URL and no outbound list of URLs
				long Webid = atoi(line.c_str());
				urlArray.push_back(Webid); 
			}
			else
			{
				while(pos < LARGEST_SIZE_T)
				{
					url = line.substr(0,pos);
					long Webid = atoi(url.c_str());
					urlArray.push_back(Webid);
					line = line.substr(pos + 1);
					pos = line.find(' ',0);
					if(pos > LARGEST_SIZE_T && line.length() >0 )
					{
						// This is the last url id on the line
						url = line;
						Webid = atoi(url.c_str());
						urlArray.push_back(Webid);
					}
				}
			}
			if(urlArray.size() > 0)
			{
				// Insert the URLs in the Hash Table i.e. unordered_map
				vector<long>::iterator it;
				long masterURLid;

				for ( it=urlArray.begin() ; it < urlArray.end(); it++ )
				{
					if(webURLs.find(*it) == webURLs.end())
					{
						WebURL *url = new WebURL((*it),initialPageRankValue);
						std::pair<long,WebURL> myURL((*it),*url);
						webURLs.insert(myURL);	// copy insertion
						delete url;
					}
					if(it == urlArray.begin())
					{
						masterURLid = *it;	// the first Web url id on the line is the master url id
					}
					else
					{
						WebURL *url = &webURLs.at(masterURLid);
						url->appendToOutboundList((webURLs.find(*it))->second);
					}
				}
			}
		}
	}
	infile.close();
}
开发者ID:ldfaiztt,项目名称:MSCS,代码行数:76,代码来源:seqpagerank.cpp

示例12: calculatePageRank

void calculatePageRank(int& iterationNumber, long& totalURLs, unordered_map<long,WebURL>& webURLs,float& dampingFactor)
{
	#ifdef _TRACE
		cout<<"\nIteration : "<<iterationNumber - 1<<" Dangling Factor = "<<danglingFactor<<endl;
	#endif	
	double tmpDanglingFactor = 0;
	unordered_map<long,WebURL>::iterator it;

	// Iterating through each Key (Representing Page) in the Map and calculating the Page Rank of the pages associated with it.
	for(it = webURLs.begin(); it != webURLs.end(); it++)
	{
		WebURL *masterURL = &(it->second);
		list<WebURL *> listofOutboundURLs = masterURL->getOutboundWebURLs();
		list<WebURL *>::iterator listite;

		double val;

		// First time call the evaluate function for the master url to change the iteration number and 
		// calculate the pagerank of the previous iteration
		masterURL->evaluate(iterationNumber,dampingFactor,totalURLs);
		#ifdef _TRACE
			cout<<"src_url: "<<masterURL->getId()<<" cur_val:["<<masterURL->getOldPageRank()<<"]"<<endl;
		#endif
		if(!listofOutboundURLs.empty())
		{
			for(listite = listofOutboundURLs.begin(); listite != listofOutboundURLs.end(); listite++)
			{
				WebURL *url = *listite;
				url->evaluate(iterationNumber,dampingFactor,totalURLs);
				val =  (masterURL->getOldPageRank() / (double)(listofOutboundURLs.size()));
				url->setNewPageRank(val + url->getNewPageRank());
				#ifdef _TRACE
					cout<<" ->tar_url:"<<url->getId()<<" cur_val:"<<url->getOldPageRank()<<" added_val:"<<val<<endl;
				#endif
			}
		}
		else
		{
			tmpDanglingFactor += masterURL->getOldPageRank();
		}
	}
	// Saving the dangling factor to use it in the next cycle
	danglingFactor = tmpDanglingFactor;
}
开发者ID:ldfaiztt,项目名称:MSCS,代码行数:44,代码来源:seqpagerank.cpp

示例13: isSVGTestURL

static inline bool isSVGTestURL(const WebURL& url)
{
    return url.isValid() && string(url.spec()).find("W3C-SVG-1.1") != string::npos;
}
开发者ID:,项目名称:,代码行数:4,代码来源:

示例14: OnChangeTargetURL

void MasterViewListener::OnChangeTargetURL(WebView* caller, const WebURL &url)
{
	DevMsg("MasterViewListener: OnChangeTargetURL: %s\n", WebStringToCharString(url.spec()));
}
开发者ID:smsithlord,项目名称:AArcade-Source,代码行数:4,代码来源:c_awesomiumlisteners.cpp

示例15: notifyErrorEventListener

void ApplicationCacheHost::notifyErrorEventListener(WebApplicationCacheHost::ErrorReason reason, const WebURL& url, int status, const WebString& message)
{
    notifyApplicationCache(ERROR_EVENT, 0, 0, reason, url.string(), status, message);
}
开发者ID:kjthegod,项目名称:WebKit,代码行数:4,代码来源:ApplicationCacheHost.cpp


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