1. 程式人生 > >谷歌瀏覽器的源碼分析 6

谷歌瀏覽器的源碼分析 6

ctrl flag which class a htm apple lag item com

前面已經介紹了這麽引人的輸入自動完成功能,並且可以在輸入超級連接框裏直接通過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的開發,它是一套基於模板的窗口框架。下一次再仔細地分析自動完成的實現過程。

再分享一下我老師大神的人工智能教程吧。零基礎!通俗易懂!風趣幽默!還帶黃段子!希望你也加入到我們人工智能的隊伍中來!https://blog.csdn.net/jiangjunshow

谷歌瀏覽器的源碼分析 6