谷歌浏览器的源码分析(6)

前面已经介绍了这么引人的输入自动完成功能,并且可以在输入超级连接框里直接通过GOOGLE搜索所有的内容,这是比较大的创新,不但可以节省界面的占用面积,还很方便大家查询的需要,比如记不住的连接,根本不需要去记了,只要你记住需要的内容就行了。这样既不需要到什么门户网站去找连接,也不需要去记住众多的网站,这个功能是非常方便的。

这个输入框的自动完成的功能,是比较智能化的。因为它会根据以往的输入自动完成,或者智能提示所需要的连接或者内容。

下面就来先看这个类的定义:

#001  // Provides the implementation of an edit control with a drop-down

#002  // autocomplete box. The box itself is implemented in autocomplete_popup.cc

#003  // This file implements the edit box and management for the popup.

#004  //

#005  // This implementation is currently appropriate for the URL bar, where the

#006  // autocomplete dropdown is always displayed because there is always a

#007  // default item. For web page autofill and other applications, this is

#008  // probably not appropriate. We may want to add a flag to determine which

#009  // of these modes we're in.

#010  class AutocompleteEdit

#011      : public CWindowImpl<AutocompleteEdit,

#012                           CRichEditCtrl,

#013                           CWinTraits<WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL |

#014                                      ES_NOHIDESEL> >,

#015        public CRichEditCommands<AutocompleteEdit>,

#016        public Menu::Delegate {

 

AutocompleteEdit继承了类CWindowImpl、类CRichEditCommands、类Menu::Delegate。其中类CWindowImpl实现了Windows窗口,它是WTL里的窗口模板类,主要用来创建窗口界面类,并且使用类CRichEditCtrl作为基类,类CRichEditCtrl主要调用Windows里的编辑类。类CRichEditCommands实现RichEdit的命令功能。Menu::Delegate类是实现智能下拉式菜单的提示界面。因此,要学习开发chrome,需要先学习WTL的开发,它是一套基于模板的窗口框架。下一次再仔细地分析自动完成的实现过程。

评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

caimouse

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值