亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

谷歌瀏覽器的源碼分析(4)

系統(tǒng) 2037 0

關(guān)于對話框,主要實現(xiàn)了讓用戶查看當(dāng)前軟件的版本、軟件信息和檢查升級的功能。因此這個類主要繼續(xù) ChromeViews::View 類、 ChromeViews::DialogDelegate GoogleUpdateStatusListener 。其中 ChromeViews::View 實現(xiàn)窗口的布局和顯示問題, ChromeViews::DialogDelegate 實現(xiàn)了事件響應(yīng),或者窗口某時是否可以顯示按鈕的問題, GoogleUpdateStatusListener 是用來實現(xiàn)接收更新程序狀態(tài)信息。

?

這個類的聲明如下:

class AboutChromeView : public ChromeViews::View,

??????????????????????? public ChromeViews::DialogDelegate,

??????????????????????? public GoogleUpdateStatusListener {

? public:

? explicit AboutChromeView(Profile* profile);

? virtual ~AboutChromeView();

?

? // Initialize the controls on the dialog.

? void Init();

?

? // Overridden from ChromeViews::View:

? virtual void GetPreferredSize(CSize *out);

? virtual void Layout();

? virtual void ViewHierarchyChanged(bool is_add,

????????????????????????????????? ?? ChromeViews::View* parent,

??????????????????????????????????? ChromeViews::View* child);

?

? // Overridden from ChromeViews::DialogDelegate:

? virtual int GetDialogButtons() const;

? virtual std::wstring GetDialogButtonLabel(DialogButton button) const;

? ? virtual bool IsDialogButtonEnabled(DialogButton button) const;

? virtual bool IsDialogButtonVisible(DialogButton button) const;

? virtual bool CanResize() const;

? virtual bool CanMaximize() const;

? virtual bool IsAlwaysOnTop() const;

? virtual bool HasAlwaysOnTopMenu() const;

? virtual bool IsModal() const;

? virtual std::wstring GetWindowTitle() const;

? virtual bool Accept();

? virtual ChromeViews::View* GetContentsView();

?

? // Overridden from GoogleUpdateStatusListener:

? virtual void OnReportResults(GoogleUpdateUpgradeResult result,

?????????????????????????????? GoogleUpdateErrorCode error_code,

?????????????????????????????? const std::wstring& version);

?

? private:

? // The visible state of the Check For Updates button.

? enum CheckButtonStatus {

? ?? CHECKBUTTON_HIDDEN = 0,

??? CHECKBUTTON_DISABLED,

??? CHECKBUTTON_ENABLED,

? };

?

? // Update the UI to show the status of the upgrade.

? void UpdateStatus(GoogleUpdateUpgradeResult result,

??????????????????? GoogleUpdateErrorCode error_code);

?

? Profile* profile_;

?

? // UI elements on the dialog.

? ChromeViews::ImageView* about_dlg_background_;

? ChromeViews::Label* about_title_label_;

? ChromeViews::TextField* version_label_;

? ChromeViews::TextField* main_text_label_;

? // UI elements we add to the parent view.

? scoped_ptr<ChromeViews::Throbber> throbber_;

? ChromeViews::ImageView success_indicator_;

? ChromeViews::ImageView update_available_indicator_;

? ChromeViews::ImageView timeout_indicator_;

? ChromeViews::Label update_label_;

?

? // Keeps track of the visible state of the Check For Updates button.

? CheckButtonStatus check_button_status_;

?

? // The class that communicates with Google Update to find out if an update is

? // available and asks it to start an upgrade.

? GoogleUpdate* google_updater_;

?

? // Our current version.

? std::wstring current_version_;

?

? // The version Google Update reports is available to us.

? std::wstring new_version_available_;

?

? DISALLOW_EVIL_CONSTRUCTORS(AboutChromeView);

};

?

通過關(guān)于對話框的分析,可以理解到 chrome 瀏覽器窗口基本組成,以及窗口繼承關(guān)系,還有事件的響應(yīng)方式。前面三次分析,主要是入門的分析,也是了解這么一個大工程的一種手段。比如測試整個工程是否可以編譯,是否可以修改代碼等等。后面的分析會以瀏覽器輸入 HTTP 連接開始,直到打開網(wǎng)頁顯示為一個主線,做一個基本的分析。

?

谷歌瀏覽器的源碼分析(4)


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 亚洲va高清中文字幕 | 国产99视频精品免视看9 | 日本一区精品久久久久影院 | 极品女神西比尔久久精品 | 97手机影院| 久久免费手机视频 | 国产免费午夜a无码v视频 | 日韩免费大片 | 亚洲欧美v视色一区二区 | 久久精品视频国产 | 天天射天天干天天操 | 久久福利影院 | 亚洲精品区在线播放一区二区 | 亚洲综合国产一区二区三区 | 久久这里有精品 | 日日摸狠狠的摸夜夜摸 | 日本一级毛片视频无遮挡免费 | 久久香焦 | a级毛片免费完整视频 | a毛片久久免费观看 | 久久精品国产清自在天天线 | 成年女人色毛片 | 天天综合天天射 | 久热re这里只有精品视频 | 国产精品99久久久久久www | 欧美操操操操 | 亚洲国产成人久久精品动漫 | 久久亚洲精品一区成人 | 免费区欧美一级毛片精品 | 毛片毛片毛片毛片 | www.夜夜骑.com | 激情影院免费 | 高清不卡免费一区二区三区 | 看免费5xxaaa毛片30厘米 | 九九99九九精彩 | 免费一级黄色片 | 天天舔天天射 | a毛片免费看 | 精品动漫一区二区三区 | 精品久久久久久中文字幕一区 | 欧美成人看片黄a免费 |