chrome 使用各种搜索引擎的方法

E:\google\home\src_tarball\tarball\chromium\src\chrome\browser\ui\browser_command_controller.cc

 

case IDC_BAIDU_SEARCH:
searchtxt=L"http://www.baidu.com/s?wd=";
searchtxt+=browser_->searchTxt_;
pNav=new NavigateParams(GetSingletonTabNavigateParams(browser_,GURL(searchtxt)));
pNav->path_behavior = NavigateParams::IGNORE_AND_NAVIGATE;
ShowSingletonTabOverwritingNTP(browser_, *pNav);
delete pNav;
pNav=NULL;
break;

case IDC_GOOGLE_SEARCH:
searchtxt=L"http://www.google.com.hk/search?hl=zh-CN&q=";
searchtxt+=browser_->searchTxt_;
pNav=new NavigateParams(GetSingletonTabNavigateParams(browser_,GURL(searchtxt)));
pNav->path_behavior = NavigateParams::IGNORE_AND_NAVIGATE;
ShowSingletonTabOverwritingNTP(browser_, *pNav);
delete pNav;
pNav=NULL;
break;

case IDC_BING_SEARCH:
searchtxt=L"http://www.bing.com/search?q=";
searchtxt+=browser_->searchTxt_;
pNav=new NavigateParams(GetSingletonTabNavigateParams(browser_,GURL(searchtxt)));
pNav->path_behavior = NavigateParams::IGNORE_AND_NAVIGATE;
ShowSingletonTabOverwritingNTP(browser_, *pNav);
delete pNav;
pNav=NULL;
break;

posted on 2013-02-25 14:58  GIS-MAN  阅读(542)  评论(0编辑  收藏  举报

导航