////////////////////////////////////////////////////////////////////////////////
// NonClientView
//
// The NonClientView is the logical root of all Views contained within a
// Window, except for the RootView which is its parent and of which it is the
// sole child. The NonClientView has two children, the NonClientFrameView which
// is responsible for painting and responding to events from the non-client
// portions of the window, and the ClientView, which is responsible for the
// same for the client area of the window:
//
// +- views::Window ------------------------------------+
// | +- views::RootView ------------------------------+ |
// | | +- views::NonClientView ---------------------+ | |
// | | | +- views::NonClientView subclass ---+ | | |
// | | | | | | | |
// | | | | << all painting and event receiving >> | | | |
// | | | | << of the non-client areas of a >> | | | |
// | | | | << views::Window. >> | | | |
// | | | | | | | |
// | | | +----------------------------------------+ | | |
// | | | +- views::ClientView or subclass --------+ | | |
// | | | | | | | |
// | | | | << all painting and event receiving >> | | | |
// | | | | << of the client areas of a >> | | | |
// | | | | << views::Window. >> | | | |
// | | | | | | | |
// | | | +----------------------------------------+ | | |
// | | +--------------------------------------------+ | |
// | +------------------------------------------------+ |
// +----------------------------------------------------+
//
// The NonClientFrameView and ClientView are siblings because due to theme
// changes the NonClientFrameView may be replaced with different
// implementations (e.g. during the switch from DWM/Aero-Glass to Vista Basic/
views::ClientView or subclass 是窗口客户区的根,上面test实例中的TestWindow 也是一个views::View。该View就是挂在【views::ClientView or subclass】的下面(作为它的子树)。具体的挂在通过函数GetContentsView() 实现。
// This method is invoked when the mouse enters this control.
//
// Default implementation does nothing. Override as needed.
virtual void OnMouseEntered(const MouseEvent& event);
// An interface implemented by an object to let it know that a button was
// pressed.
class ButtonListener {
public:
virtual void ButtonPressed(Button* sender) = 0;
};
GRIT (Google Resource and Internationalization Tool) is a tool for Windows
projects to manage resources and simplify the localization workflow.
在命令行输入命令【python grit.py】(该文件是整个grit的入口)有如下输出
GRIT - the Google Resource and Internationalization Tool
Copyright (c) Google Inc. 2009
Usage: grit [GLOBALOPTIONS] TOOL [args to tool]
Global options:
-i INPUT Specifies the INPUT file to use (a .grd file). If this is not
specified, GRIT will look for the environment variable GRIT_INPUT.
If it is not present either, GRIT will try to find an input file
named 'resource.grd' in the current working directory.
-v Print more verbose runtime information.
-x Print extremely verbose runtime information. Implies -v
-p FNAME Specifies that GRIT should profile its execution and output the
results to the file FNAME.
Tools:
TOOL can be one of the following:
build A tool that builds RC files for compilation.
newgrd Create a new empty .grd file.
rc2grd A tool for converting .rc source files to .grd files.
transl2tc Import existing translations in RC format into the TC
sdiff View differences without regard for translateable portions.
resize Generate a file where you can resize a given dialog.
unit Use this tool to run all the unit tests for GRIT.
count Exports all translateable messages into an XMB file.
For more information on how to use a particular tool, and the specific
arguments you can send to that tool, execute 'grit help TOOL'
<?xml version="1.0" encoding="UTF-8"?>
<grit base_dir="." latest_public_release="0" current_release="1"
source_lang_id="en" enc_check="möl">
<outputs>
<output filename="grit/generated_resources.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="generated_resources_zh-CN.rc" type="rc_all" lang="zh-CN" />
<output filename="generated_resources_zh-TW.rc" type="rc_all" lang="zh-TW" />
<output filename="generated_resources_zh-CN.pak" type="data_package" lang="zh-CN" />
<output filename="generated_resources_zh-TW.pak" type="data_package" lang="zh-TW" />
</outputs>
<translations>
<file path="resources/generated_resources_zh-CN.xtb" lang="zh-CN" />
<file path="resources/generated_resources_zh-TW.xtb" lang="zh-TW" />
</translations>
<release seq="1" allow_pseudo="false">
<messages fallback_to_english="true">
<!-- TODO add all of your "string table" messages here. Remember to
change nontranslateable parts of the messages into placeholders (using the
<ph> element). You can also use the 'grit add' tool to help you identify
nontranslateable parts and create placeholders for them. -->
<message name="IDS_SHOWFULLHISTORY_LINK" desc="test">
Show Full History
</message>
</messages>
</release>
</grit>
:: Batch file run as build command for .grd files
:: The custom build rule is set to expect (inputfile).h and (inputfile).rc
:: our grd files must generate files with the same basename.
@echo off
setlocal
… 忽略 …
:: Put cygwin in the path
call %SolutionDir%\..\third_party\cygwin\setup_env.bat
%SolutionDir%\..\third_party\python_24\python.exe %SolutionDir%\..\tools\grit\grit.py \
-i %InFile% build -o %OutDir% %PreProc1% %PreProc2% %PreProc3% %PreProc4% %PreProc5
//////////////////////////////////////////////
//
// Version
//
... 省略 ...
BEGIN
VALUE "CompanyName", "@COMPANY_FULLNAME@"
VALUE "FileDescription", "@PRODUCT_FULLNAME@"
VALUE "FileVersion", "0.0.0.0"
VALUE "InternalName", "chrome_exe"
VALUE "LegalCopyright", "@COPYRIGHT@"
... 省略 ...
END
END
... 省略 ...
END
:: Batch file run as build command for vers.vcproj
@echo off
setlocal
set InFile=%~1
set SolutionDir=%~2
set IntDir=%~3
set OutFile=%~4
set VarsBat=%IntDir%/vers-vars.bat
:: Put cygwin in the path
call %SolutionDir%\..\third_party\cygwin\setup_env.bat
:: Load version digits as environment variables
cat %SolutionDir%\VERSION | sed "s/\(.*\)/set \1/" > %VarsBat%
:: Load branding strings as environment variables
set Distribution="chromium"
if "%CHROMIUM_BUILD%" == "_google_chrome" set Distribution="google_chrome"
cat %SolutionDir%app\theme\%Distribution%\BRANDING | sed "s/\(.*\)/set \1/" >> %VarsBat%
set OFFICIAL_BUILD=0
if "%CHROME_BUILD_TYPE%" == "_official" set OFFICIAL_BUILD=1
:: Determine the current repository revision number
set PATH=%~dp0..\..\..\..\third_party\svn;%PATH%
svn.exe info | grep.exe "Revision:" | cut -d" " -f2- | sed "s/\(.*\)/set LASTCHANGE=\1/" >> %VarsBat%
call %VarsBat%
::echo LastChange: %LASTCHANGE%
:: output file
cat %InFile% | sed "s/@MAJOR@/%MAJOR%/" ^
| sed "s/@MINOR@/%MINOR%/" ^
| sed "s/@BUILD@/%BUILD%/" ^
| sed "s/@PATCH@/%PATCH%/" ^
| sed "s/@COMPANY_FULLNAME@/%COMPANY_FULLNAME%/" ^
| sed "s/@COMPANY_SHORTNAME@/%COMPANY_SHORTNAME%/" ^
| sed "s/@PRODUCT_FULLNAME@/%PRODUCT_FULLNAME%/" ^
| sed "s/@PRODUCT_SHORTNAME@/%PRODUCT_SHORTNAME%/" ^
| sed "s/@PRODUCT_EXE@/%PRODUCT_EXE%/" ^
| sed "s/@COPYRIGHT@/%COPYRIGHT%/" ^
| sed "s/@OFFICIAL_BUILD@/%OFFICIAL_BUILD%/" ^
| sed "s/@LASTCHANGE@/%LASTCHANGE%/" > %OutFile%
endlocal
注意上述红色标示的部分
VERSION 部分是获取Chrome预先写好的版本参数文件【src\chrome\VERSION】,内容如下
SaveLaterTask* task = new SaveLaterTask(pref_filename_, data);
if (thread != NULL) {
// We can use the background thread, it will take ownership of the task.
thread->message_loop()->PostTask(FROM_HERE, task);
} else {
// In unit test mode, we have no background thread, just execute.
task->Run();
delete task;
}