谷歌瀏覽器的源碼分析 6
這個輸入框的自動完成的功能,是比較智能化的。因為它會根據以往的輸入自動完成,或者智能提示所需要的連接或者內容。
下面就來先看這個類的定義:
#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
#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的開發,它是一套基於模板的窗口框架。下一次再仔細地分析自動完成的實現過程。
再分享一下我老師大神的人工智能教程吧。零基礎!通俗易懂!風趣幽默!還帶黃段子!希望你也加入到我們人工智能的隊伍中來!https://blog.csdn.net/jiangjunshow
谷歌瀏覽器的源碼分析 6