diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-09 21:58:55 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-09 21:58:55 +0000 |
commit | 1bce0b66d9de24d21afc8cd672f7e1100dfe0b55 (patch) | |
tree | 0fa9daf6423986af953f53c5fb0f226034fcc773 | |
parent | 4ca1372726d465d18036bf3142f45ca47006ba4e (diff) | |
download | chromium_src-1bce0b66d9de24d21afc8cd672f7e1100dfe0b55.zip chromium_src-1bce0b66d9de24d21afc8cd672f7e1100dfe0b55.tar.gz chromium_src-1bce0b66d9de24d21afc8cd672f7e1100dfe0b55.tar.bz2 |
Move browser_resources.rc into a a grd file. While I'm at it,
I removed the flatten_html visual studio rule and just rolled the
functionality directly into GRIT.
The sln change is to have browser depend on browser_resources (now needed for browser_resources.h).
Review URL: http://codereview.chromium.org/21148
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9418 0039d316-1c4b-4281-b951-d872f2087c98
24 files changed, 177 insertions, 266 deletions
diff --git a/chrome/SConscript b/chrome/SConscript index dd33cde..affe6a5 100644 --- a/chrome/SConscript +++ b/chrome/SConscript @@ -36,7 +36,8 @@ if env_res.Bit('windows'): ], ) - browser_res = env_res.RES('browser/browser_resources.rc') + browser_res = env_res.RES( + '$TARGET_ROOT/grit_derived_sources/browser_resources.rc') chrome_exe_res = env_res.RES('app/chrome_exe.rc'), chrome_dll_res = env_res.RES('app/chrome_dll.rc') env_res.Depends(chrome_dll_res, 'installer/util/installer_util_strings.rc') @@ -82,6 +83,12 @@ google_chrome = env_grd.GRIT( '$CHROME_SRC_DIR/chrome/app/google_chrome_strings.grd') grit_files.extend(google_chrome) +# NOTE: fake target gets replaced with real targets from reading .grd +browser_resources = env_grd.GRIT( + '$TARGET_ROOT/grit_derived_sources/fake_browser_target', + '$CHROME_SRC_DIR/chrome/browser/browser_resources.grd') +grit_files.extend(browser_resources) + input_files = ChromeFileList([ 'app/generated_resources.grd', 'app/google_chrome_strings.grd', @@ -260,7 +267,8 @@ input_files = ChromeFileList([ # in favor of generating the hierarchy to reflect the file system. MSVSFilter('resources', [ '$WEBKIT_DIR/glue/resources/aliasb.cur', - 'browser/browser_resources.rc', + Derived(env_dll.File('$TARGET_ROOT/' + + 'grit_derived_sources/browser_resources.rc')), '$WEBKIT_DIR/glue/resources/cell.cur', 'app/check_dependents.bat', 'app/chrome.dll.deps', @@ -658,25 +666,6 @@ p.AddConfig('Release|Win32', ############################################################################## # TODO(sgk): move to separate .scons file for browser_resources ############# -env_flat = env.Clone( - BROWSER_RESOURCES = Dir('browser_resources'), - HTML_INLINE = env.File( - '$CHROME_SRC_DIR/chrome/tools/build/win/html_inline.py'), - FLATTEN_HTML_COM = '$PYTHON $HTML_INLINE $SOURCE $TARGET', -) - -def FlatHtmlEmitter(target, source, env): - # When we get the target, it will have the "_flat.html" suffix, - # but will be next to the sourcefile. Replace it with a - # string that puts it in the $BROWSER_RESOURCES directory. - target = [env.File('$BROWSER_RESOURCES/' + target[0].name)] - return target, source - -env_flat['BUILDERS']['FlatHtml'] = Builder(action='$FLATTEN_HTML_COM', - suffix='_flat.html', - source_suffix='.html', - emitter=FlatHtmlEmitter) - input_files = ChromeFileList([ 'browser/resources/about_credits.html', 'browser/resources/about_memory.html', @@ -693,17 +682,6 @@ input_files = ChromeFileList([ 'browser/security/resources/ssl_roadblock_icon.png', ]) -# TODO(port) -if env_flat.Bit('windows'): - flats_out = [] - for i in input_files: - if str(i).endswith('.html'): - flats_out.extend(env_flat.FlatHtml(i)) - - # TODO(sgk): Remove when we upgrade to SCons 1.1.0, which - # determines implicit dependencies from .rc files. - env_flat.Depends(browser_res, flats_out) - p = env.ChromeMSVSProject('browser/resources/browser_resources.vcproj', dest=('$CHROME_SRC_DIR/chrome/' + 'browser/resources/browser_resources.vcproj'), @@ -715,15 +693,12 @@ p = env.ChromeMSVSProject('browser/resources/browser_resources.vcproj', local_directory_prefix='./', tools=[ 'VCPreBuildEventTool', - 'Flattened HTML Resource', 'VCCustomBuildTool', 'VCMIDLTool', 'VCPostBuildEventTool', ], ConfigurationType='10') -p.AddToolFile('tools/build/win/flattened_html_file.rules') - p.AddConfig('Debug|Win32', InheritedPropertySheets=[ '$(SolutionDir)../build/common.vsprops', @@ -759,7 +734,7 @@ env.SConscript(sconscript_files, exports=['env', 'env_res', 'env_test']) # TODO(port) if env.Bit('windows'): - env.InstallAs('$LIB_DIR/${LIBPREFIX}jscre${LIBSUFFIX}', + env.InstallAs('$LIBS_DIR/${LIBPREFIX}jscre${LIBSUFFIX}', '$WEBKIT_DIR/JavaScriptCore_pcre.lib') diff --git a/chrome/app/chrome_dll.rc b/chrome/app/chrome_dll.rc index 07cf3ca..940d57b 100644 --- a/chrome/app/chrome_dll.rc +++ b/chrome/app/chrome_dll.rc @@ -235,6 +235,10 @@ END #include "installer_util_strings.rc" +#ifdef CHROME_PERSONALIZATION +#include "chrome\\personalization\\personalization_resources.rc" +#endif + // We include these resources because all ICON types need to be in the // same .rc file. See: // http://www.technewsgroups.net/group/microsoft.public.dotnet.general/topic2111.aspx diff --git a/chrome/app/chrome_dll.vcproj b/chrome/app/chrome_dll.vcproj index 2a204f1..87135dd 100644 --- a/chrome/app/chrome_dll.vcproj +++ b/chrome/app/chrome_dll.vcproj @@ -164,11 +164,7 @@ > </File> <File - RelativePath="..\browser\browser_resources.h" - > - </File> - <File - RelativePath="..\browser\browser_resources.rc" + RelativePath="$(OutDir)\grit_derived_sources\browser_resources.rc" > </File> <File diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons index 8584b73..af9df76 100644 --- a/chrome/browser/browser.scons +++ b/chrome/browser/browser.scons @@ -77,7 +77,6 @@ input_files = ChromeFileList([ 'browser_process.h', 'browser_process_impl.cc', 'browser_process_impl.h', - 'browser_resources.h', 'browser_shutdown.cc', 'browser_shutdown.h', 'browser_url_handler.cc', diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj index e99c131..91c6b41 100644 --- a/chrome/browser/browser.vcproj +++ b/chrome/browser/browser.vcproj @@ -266,10 +266,6 @@ > </File> <File - RelativePath=".\browser_resources.h" - > - </File> - <File RelativePath=".\browser_shutdown.cc" > </File> diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 0ca3435..d8ff07f 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -17,7 +17,6 @@ #include "chrome/app/locales/locale_settings.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/browser_resources.h" #include "chrome/browser/dom_ui/chrome_url_data_manager.h" #include "chrome/browser/memory_details.h" #include "chrome/browser/net/dns_global.h" @@ -42,6 +41,8 @@ #include "chrome/browser/views/about_network_dialog.h" #endif +// Generated by GRIT +#include "browser_resources.h" #include "chromium_strings.h" #include "generated_resources.h" diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd new file mode 100755 index 0000000..9fd2215 --- /dev/null +++ b/chrome/browser/browser_resources.grd @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<grit latest_public_release="0" current_release="1">
+ <outputs>
+ <output filename="browser_resources.h" type="rc_header"> + <emit emit_type='prepend'></emit> + </output> + <output filename="browser_resources.rc" type="rc_all" /> + <output filename="browser_resources.pak" type="data_package" /> + </outputs>
+ <release seq="1">
+ <includes>
+ <include name="IDR_ABOUT_PLUGINS_HTML" file="resources\about_plugins.html" type="BINDATA" />
+ <include name="IDR_ABOUT_VERSION_HTML" file="resources\about_version.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_ABOUT_MEMORY_HTML" file="resources\about_memory.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_ABOUT_STATS_HTML" file="resources\about_stats.html" type="BINDATA" />
+ <include name="IDR_SSL_ROAD_BLOCK_HTML" file="security\resources\ssl_roadblock.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_SSL_ERROR_HTML" file="security\resources\ssl_error.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_NEW_TAB_HTML" file="resources\new_tab.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_SAFE_BROWSING_MALWARE_BLOCK" file="resources\safe_browsing_malware_block.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_SAFE_BROWSING_PHISHING_BLOCK" file="resources\safe_browsing_phishing_block.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_SAFE_BROWSING_MULTIPLE_THREAT_BLOCK" file="resources\safe_browsing_multiple_threat_block.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_INCOGNITO_TAB_HTML" file="resources\incognito_tab.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_CREDITS_HTML" file="resources\about_credits.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_HISTORY_HTML" file="resources\history.html" flattenhtml="true" type="BINDATA" />
+ </includes>
+ </release>
+</grit>
diff --git a/chrome/browser/browser_resources.h b/chrome/browser/browser_resources.h deleted file mode 100644 index e856337..0000000 --- a/chrome/browser/browser_resources.h +++ /dev/null @@ -1,16 +0,0 @@ -// TODO(tc): Come up with a way to automate the generation of these -// IDs so they don't collide with other rc files. -#define IDR_ABOUT_PLUGINS_HTML 201 -#define IDR_ABOUT_VERSION_HTML 202 -#define IDR_ABOUT_MEMORY_HTML 204 -#define IDR_ABOUT_STATS_HTML 205 -#define IDR_SSL_ROAD_BLOCK_HTML 206 -#define IDR_SSL_ERROR_HTML 207 -#define IDR_NEW_TAB_HTML 208 -#define IDR_SAFE_BROWSING_MALWARE_BLOCK 209 -#define IDR_SAFE_BROWSING_PHISHING_BLOCK 210 -#define IDR_SAFE_BROWSING_MULTIPLE_THREAT_BLOCK 211 -#define IDR_INCOGNITO_TAB_HTML 212 -#define IDR_CREDITS_HTML 213 -#define IDR_HISTORY_HTML 214 - diff --git a/chrome/browser/browser_resources.rc b/chrome/browser/browser_resources.rc deleted file mode 100644 index b061e4e..0000000 --- a/chrome/browser/browser_resources.rc +++ /dev/null @@ -1,33 +0,0 @@ -// Resources used by browser/*. -// -// Paths in this file are relative to SolutionDir. - -#ifdef APSTUDIO_INVOKED - #error // Don't open in the Visual Studio resource editor! -#endif //APSTUDIO_INVOKED - -#include "browser\\browser_resources.h" - -#ifdef CHROME_PERSONALIZATION -#include "chrome\\personalization\\personalization_resources.rc" -#endif - - -///////////////////////////////////////////////////////////////////////////// -// -// data resources -// - -IDR_ABOUT_PLUGINS_HTML BINDATA "browser\\resources\\about_plugins.html" -IDR_ABOUT_VERSION_HTML BINDATA "browser_resources\\about_version_flat.html" -IDR_ABOUT_MEMORY_HTML BINDATA "browser_resources\\about_memory_flat.html" -IDR_ABOUT_STATS_HTML BINDATA "browser\\resources\\about_stats.html" -IDR_SSL_ROAD_BLOCK_HTML BINDATA "browser_resources\\ssl_roadblock_flat.html" -IDR_SSL_ERROR_HTML BINDATA "browser_resources\\ssl_error_flat.html" -IDR_NEW_TAB_HTML BINDATA "browser_resources\\new_tab_flat.html" -IDR_SAFE_BROWSING_MALWARE_BLOCK BINDATA "browser_resources\\safe_browsing_malware_block_flat.html" -IDR_SAFE_BROWSING_PHISHING_BLOCK BINDATA "browser_resources\\safe_browsing_phishing_block_flat.html" -IDR_SAFE_BROWSING_MULTIPLE_THREAT_BLOCK BINDATA "browser_resources\\safe_browsing_multiple_threat_block_flat.html" -IDR_INCOGNITO_TAB_HTML BINDATA "browser_resources\\incognito_tab_flat.html" -IDR_CREDITS_HTML BINDATA "browser_resources\\about_credits_flat.html" -IDR_HISTORY_HTML BINDATA "browser_resources\\history_flat.html"
\ No newline at end of file diff --git a/chrome/browser/dom_ui/history_ui.cc b/chrome/browser/dom_ui/history_ui.cc index bab1852..ed6f3b2 100644 --- a/chrome/browser/dom_ui/history_ui.cc +++ b/chrome/browser/dom_ui/history_ui.cc @@ -10,7 +10,6 @@ #include "base/time.h" #include "base/time_format.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/browser_resources.h" #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/profile.h" @@ -20,6 +19,8 @@ #include "chrome/common/resource_bundle.h" #include "chrome/common/time_format.h" +// Generated by GRIT +#include "browser_resources.h" #include "chromium_strings.h" #include "generated_resources.h" diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index e8191a5..c817905 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -10,7 +10,6 @@ #include "chrome/browser/bookmarks/bookmark_utils.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/browser_resources.h" #include "chrome/browser/dom_ui/dom_ui_contents.h" #include "chrome/browser/history_tab_ui.h" #include "chrome/browser/history/page_usage_data.h" @@ -32,6 +31,8 @@ #include "chrome/personalization/personalization.h" #endif +// Generated by GRIT +#include "browser_resources.h" #include "chromium_strings.h" #include "generated_resources.h" diff --git a/chrome/browser/resources/browser_resources.vcproj b/chrome/browser/resources/browser_resources.vcproj index 0a51fd9..67bb42f 100644 --- a/chrome/browser/resources/browser_resources.vcproj +++ b/chrome/browser/resources/browser_resources.vcproj @@ -1,125 +1,89 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="browser_resources" - ProjectGUID="{B95AB527-F7DB-41E9-AD91-EB51EE0F56BE}" - RootNamespace="browser_resources" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - <ToolFile - RelativePath="..\..\tools\build\win\flattened_html_file.rules" - /> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - ConfigurationType="10" - InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\debug.vsprops" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="Flattened HTML Resource" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - ConfigurationType="10" - InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\release.vsprops" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="Flattened HTML Resource" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <File - RelativePath=".\about_credits.html" - > - </File> - <File - RelativePath=".\about_memory.html" - > - </File> - <File - RelativePath=".\about_stats.html" - > - </File> - <File - RelativePath=".\about_version.html" - > - </File> - <File - RelativePath=".\history.html" - > - </File> - <File - RelativePath=".\incognito_tab.html" - > - </File> - <File - RelativePath=".\new_tab.html" - > - </File> - <File - RelativePath=".\safe_browsing_malware_block.html" - > - </File> - <File - RelativePath=".\safe_browsing_multiple_threat_block.html" - > - </File> - <File - RelativePath=".\safe_browsing_phishing_block.html" - > - </File> - <File - RelativePath="..\security\resources\ssl_error.html" - > - </File> - <File - RelativePath="..\security\resources\ssl_roadblock.html" - > - </File> - <File - RelativePath="..\security\resources\ssl_roadblock_background.png" - > - </File> - <File - RelativePath="..\security\resources\ssl_roadblock_icon.png" - > - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="browser_resources"
+ ProjectGUID="{B95AB527-F7DB-41E9-AD91-EB51EE0F56BE}"
+ RootNamespace="browser_resources"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ <ToolFile
+ RelativePath="..\..\..\tools\grit\build\grit_resources.rules"
+ />
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="10"
+ InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\debug.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="WebKitVersion"
+ />
+ <Tool
+ Name="GRIT Generated Resources"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="10"
+ InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\release.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="WebKitVersion"
+ />
+ <Tool
+ Name="GRIT Generated Resources"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Generated Files"
+ SourceControlFiles="false"
+ >
+ <File
+ RelativePath="$(OutDir)\grit_derived_sources\browser_resources.h"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\browser_resources.grd"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index c6b6feb..712aeb4 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -9,7 +9,6 @@ #include "base/string_util.h" #include "chrome/app/locales/locale_settings.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/browser_resources.h" #include "chrome/browser/dom_operation_notification_details.h" #include "chrome/browser/dom_ui/new_tab_ui.h" #include "chrome/browser/google_util.h" @@ -24,6 +23,8 @@ #include "generated_resources.h" #include "net/base/escape.h" +// Generated by GRIT +#include "browser_resources.h" // For malware interstitial pages, we link the problematic URL to Google's // diagnostic page. diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc index 313908e..6833e3a 100644 --- a/chrome/browser/ssl/ssl_blocking_page.cc +++ b/chrome/browser/ssl/ssl_blocking_page.cc @@ -7,7 +7,6 @@ #include "base/string_piece.h" #include "base/values.h" #include "chrome/browser/browser.h" -#include "chrome/browser/browser_resources.h" #include "chrome/browser/cert_store.h" #include "chrome/browser/dom_operation_notification_details.h" #include "chrome/browser/ssl/ssl_error_info.h" @@ -21,6 +20,8 @@ #include "chrome/common/pref_service.h" #include "chrome/common/resource_bundle.h" +// Generated by GRIT +#include "browser_resources.h" #include "generated_resources.h" // Note that we always create a navigation entry with SSL errors. diff --git a/chrome/browser/ssl/ssl_policy.cc b/chrome/browser/ssl/ssl_policy.cc index 1784deb..19b4575 100644 --- a/chrome/browser/ssl/ssl_policy.cc +++ b/chrome/browser/ssl/ssl_policy.cc @@ -7,7 +7,6 @@ #include "base/singleton.h" #include "base/string_piece.h" #include "base/string_util.h" -#include "chrome/browser/browser_resources.h" #include "chrome/browser/cert_store.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/ssl/ssl_error_info.h" @@ -28,6 +27,9 @@ #include "webkit/glue/console_message_level.h" #include "webkit/glue/resource_type.h" +// Generated by GRIT +#include "browser_resources.h" + // Wrap all these helper classes in an anonymous namespace. namespace { diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index 9c4ea0e..9685a4f 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -8,7 +8,6 @@ #include "base/thread.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" -#include "chrome/browser/browser_resources.h" #include "chrome/browser/dom_operation_notification_details.h" #include "chrome/browser/renderer_host/render_widget_host_view_win.h" #include "chrome/browser/tab_contents/navigation_controller.h" @@ -20,6 +19,9 @@ #include "chrome/views/window_delegate.h" #include "net/base/escape.h" +// Generated by GRIT +#include "browser_resources.h" + namespace { class ResourceRequestTask : public Task { diff --git a/chrome/chrome.sln b/chrome/chrome.sln index c381c68..fc4223d 100755 --- a/chrome/chrome.sln +++ b/chrome/chrome.sln @@ -20,6 +20,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "browser", "browser\browser. ProjectSection(ProjectDependencies) = postProject {4052059A-D72B-4183-B5C2-9D1B099E9E35} = {4052059A-D72B-4183-B5C2-9D1B099E9E35} {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} = {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} + {B95AB527-F7DB-41E9-AD91-EB51EE0F56BE} = {B95AB527-F7DB-41E9-AD91-EB51EE0F56BE} {D9DDAF60-663F-49CC-90DC-3D08CC3D1B28} = {D9DDAF60-663F-49CC-90DC-3D08CC3D1B28} EndProjectSection EndProject diff --git a/chrome/chrome.xcodeproj/generate_headers.sh b/chrome/chrome.xcodeproj/generate_headers.sh index f656be2..2e54526 100755 --- a/chrome/chrome.xcodeproj/generate_headers.sh +++ b/chrome/chrome.xcodeproj/generate_headers.sh @@ -28,3 +28,13 @@ then -i "${PROJECT_DIR}/app/chromium_strings.grd" build \ -o "${GRIT_DIR}" fi + +# compare browser_resources.grd to browser_resources.h. If the .h is +# older or doesn't exist, rebuild it +if [ "${GRIT_DIR}/browser_resources.h" -ot \ + "${PROJECT_DIR}/browser/browser_resources.grd" ] +then + python "${PROJECT_DIR}/../tools/grit/grit.py" \ + -i "${PROJECT_DIR}/browser/browser_resources.grd" build \ + -o "${GRIT_DIR}" +fi diff --git a/chrome/chrome_kjs.sln b/chrome/chrome_kjs.sln index c077e9d..41d28d4 100644 --- a/chrome/chrome_kjs.sln +++ b/chrome/chrome_kjs.sln @@ -20,6 +20,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "browser", "browser\browser. ProjectSection(ProjectDependencies) = postProject {4052059A-D72B-4183-B5C2-9D1B099E9E35} = {4052059A-D72B-4183-B5C2-9D1B099E9E35} {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} = {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} + {B95AB527-F7DB-41E9-AD91-EB51EE0F56BE} = {B95AB527-F7DB-41E9-AD91-EB51EE0F56BE} {D9DDAF60-663F-49CC-90DC-3D08CC3D1B28} = {D9DDAF60-663F-49CC-90DC-3D08CC3D1B28} EndProjectSection EndProject diff --git a/chrome/tools/build/win/flattened_html_file.bat b/chrome/tools/build/win/flattened_html_file.bat deleted file mode 100644 index 9dcd7b6..0000000 --- a/chrome/tools/build/win/flattened_html_file.bat +++ /dev/null @@ -1,14 +0,0 @@ -:: Batch file run as build command for flattening files -:: The custom build rule is set to expect (inputfile).html -@echo off - -setlocal - -set InFile=%~1 -set SolutionDir=%~2 -set OutFile=%~3 - -:: Put cygwin in the path -call %SolutionDir%\..\third_party\cygwin\setup_env.bat - -%SolutionDir%\..\third_party\python_24\python.exe %SolutionDir%\tools\build\win\html_inline.py %InFile% %OutFile% diff --git a/chrome/tools/build/win/flattened_html_file.rules b/chrome/tools/build/win/flattened_html_file.rules deleted file mode 100644 index 8cc33ba..0000000 --- a/chrome/tools/build/win/flattened_html_file.rules +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<VisualStudioToolFile - Name="Flattened HTML Resource" - Version="8.00" - > - <Rules> - <CustomBuildRule - Name="Flattened HTML Resource" - DisplayName="Flattened HTML Resource" - CommandLine="$(SolutionDir)\tools\build\win\flattened_html_file.bat $(InputPath) "$(SolutionDir)" "$(IntDir)\$(InputName)_flat.html"" - Outputs="$(IntDir)\$(InputName)_flat.html" - AdditionalDependencies="$(SolutionDir)\tools\build\win\flattened_html_file.bat" - FileExtensions="*.html" - ExecutionDescription="Generating resources..." - > - <Properties> - </Properties> - </CustomBuildRule> - </Rules> -</VisualStudioToolFile> diff --git a/chrome/tools/build/win/html_inline.py b/tools/grit/grit/format/html_inline.py index 6423866..f66737c 100755 --- a/chrome/tools/build/win/html_inline.py +++ b/tools/grit/grit/format/html_inline.py @@ -19,7 +19,7 @@ import sys import base64 import mimetypes -DIST_DEFAULT = 'CHROMIUM' +DIST_DEFAULT = 'chromium' DIST_ENV_VAR = 'CHROMIUM_BUILD' DIST_SUBSTR = '%DISTRIBUTION%' diff --git a/tools/grit/grit/format/rc.py b/tools/grit/grit/format/rc.py index a2cdca0..1975acf 100644 --- a/tools/grit/grit/format/rc.py +++ b/tools/grit/grit/format/rc.py @@ -11,9 +11,9 @@ import types import re from grit import util +from grit.format import html_inline from grit.format import interface - # Matches all different types of linebreaks. _LINEBREAKS = re.compile('\r\n|\n|\r') @@ -390,7 +390,8 @@ class RcSection(interface.ItemFormatter): class RcInclude(interface.ItemFormatter): '''Writes out an item that is included in an .rc file (e.g. an ICON)''' - def __init__(self, type, filenameWithoutPath = 0, relative_path = 0): + def __init__(self, type, filenameWithoutPath = 0, relative_path = 0, + flatten_html = 0): '''Indicates to the instance what the type of the resource include is, e.g. 'ICON' or 'HTML'. Case must be correct, i.e. if the type is all-caps the parameter should be all-caps. @@ -401,6 +402,7 @@ class RcInclude(interface.ItemFormatter): self.type_ = type self.filenameWithoutPath = filenameWithoutPath self.relative_path_ = relative_path + self.flatten_html = flatten_html def Format(self, item, lang='en', begin_item=True, output_dir='.'): if not begin_item: @@ -419,10 +421,18 @@ class RcInclude(interface.ItemFormatter): # The FileForLanguage() Function has the side effect of generating the file # if needed (e.g. if it is an HTML file include). filename = os.path.abspath(item.FileForLanguage(lang, output_dir)) - if self.filenameWithoutPath: + if self.flatten_html: + # Generate the flattened HTML file. + flat_filename = os.path.join(output_dir, os.path.basename(filename)) + html_inline.InlineFile(filename, flat_filename) + + # Include the flattened HTML file. + filename = os.path.basename(filename) + elif self.filenameWithoutPath: filename = os.path.basename(filename) elif self.relative_path_: filename = _MakeRelativePath(output_dir, filename) + filename = filename.replace('\\', '\\\\') # escape for the RC format if isinstance(item, structure.StructureNode) and item.IsExcludedFromRc(): diff --git a/tools/grit/grit/node/include.py b/tools/grit/grit/node/include.py index 47599a42..032674b 100644 --- a/tools/grit/grit/node/include.py +++ b/tools/grit/grit/node/include.py @@ -27,6 +27,7 @@ class IncludeNode(base.Node): return {'translateable' : 'true', 'generateid': 'true', 'filenameonly': 'false', + 'flattenhtml': 'false', 'relativepath': 'false', } @@ -37,7 +38,8 @@ class IncludeNode(base.Node): self.SatisfiesOutputCondition()): return grit.format.rc.RcInclude(self.attrs['type'].upper(), self.attrs['filenameonly'] == 'true', - self.attrs['relativepath'] == 'true') + self.attrs['relativepath'] == 'true', + self.attrs['flattenhtml'] == 'true') else: return super(type(self), self).ItemFormatter(t) |