summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/SConscript47
-rw-r--r--chrome/app/chrome_dll.rc4
-rw-r--r--chrome/app/chrome_dll.vcproj6
-rw-r--r--chrome/browser/browser.scons1
-rw-r--r--chrome/browser/browser.vcproj4
-rw-r--r--chrome/browser/browser_about_handler.cc3
-rwxr-xr-xchrome/browser/browser_resources.grd27
-rw-r--r--chrome/browser/browser_resources.h16
-rw-r--r--chrome/browser/browser_resources.rc33
-rw-r--r--chrome/browser/dom_ui/history_ui.cc3
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc3
-rw-r--r--chrome/browser/resources/browser_resources.vcproj214
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc3
-rw-r--r--chrome/browser/ssl/ssl_blocking_page.cc3
-rw-r--r--chrome/browser/ssl/ssl_policy.cc4
-rw-r--r--chrome/browser/tab_contents/interstitial_page.cc4
-rwxr-xr-xchrome/chrome.sln1
-rwxr-xr-xchrome/chrome.xcodeproj/generate_headers.sh10
-rw-r--r--chrome/chrome_kjs.sln1
-rw-r--r--chrome/tools/build/win/flattened_html_file.bat14
-rw-r--r--chrome/tools/build/win/flattened_html_file.rules20
-rwxr-xr-xchrome/tools/build/win/html_inline.py117
22 files changed, 160 insertions, 378 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) &quot;$(SolutionDir)&quot; &quot;$(IntDir)\$(InputName)_flat.html&quot;"
- 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/chrome/tools/build/win/html_inline.py
deleted file mode 100755
index 6423866..0000000
--- a/chrome/tools/build/win/html_inline.py
+++ /dev/null
@@ -1,117 +0,0 @@
-#!/usr/bin/python
-# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Flattens a HTML file by inlining its external resources.
-
-This is a small script that takes a HTML file, looks for src attributes
-and inlines the specified file, producing one HTML file with no external
-dependencies.
-
-This does not inline CSS styles, nor does it inline anything referenced
-from an inlined file.
-"""
-
-import os
-import re
-import sys
-import base64
-import mimetypes
-
-DIST_DEFAULT = 'CHROMIUM'
-DIST_ENV_VAR = 'CHROMIUM_BUILD'
-DIST_SUBSTR = '%DISTRIBUTION%'
-
-def ReadFile(input_filename):
- """Helper function that returns input_filename as a string.
-
- Args:
- input_filename: name of file to be read
-
- Returns:
- string
- """
- f = open(input_filename, 'rb')
- file_contents = f.read()
- f.close()
- return file_contents
-
-def SrcInline(src_match, base_path, distribution):
- """regex replace function.
-
- Takes a regex match for src="filename", attempts to read the file
- at 'filename' and returns the src attribute with the file inlined
- as a data URI. If it finds DIST_SUBSTR string in file name, replaces
- it with distribution.
-
- Args:
- src_match: regex match object with 'filename' named capturing group
- base_path: path that to look for files in
- distribution: string that should replace DIST_SUBSTR
-
- Returns:
- string
- """
- filename = src_match.group('filename')
-
- if filename.find(':') != -1:
- # filename is probably a URL, which we don't want to bother inlining
- return src_match.group(0)
-
- filename = filename.replace('%DISTRIBUTION%', distribution)
- filepath = os.path.join(base_path, filename)
- mimetype = mimetypes.guess_type(filename)[0] or 'text/plain'
- inline_data = base64.standard_b64encode(ReadFile(filepath))
-
- prefix = src_match.string[src_match.start():src_match.start('filename')-1]
- return "%s\"data:%s;base64,%s\"" % (prefix, mimetype, inline_data)
-
-def InlineFile(input_filename, output_filename):
- """Inlines the resources in a specified file.
-
- Reads input_filename, finds all the src attributes and attempts to
- inline the files they are referring to, then writes the result
- to output_filename.
-
- Args:
- input_filename: name of file to read in
- output_filename: name of file to be written to
- """
- print "inlining %s to %s" % (input_filename, output_filename)
- input_filepath = os.path.dirname(input_filename)
-
- distribution = DIST_DEFAULT
- if DIST_ENV_VAR in os.environ.keys():
- distribution = os.environ[DIST_ENV_VAR]
- if len(distribution) > 1 and distribution[0] == '_':
- distribution = distribution[1:].lower()
-
- def SrcReplace(src_match):
- """Helper function to provide SrcInline with the base file path"""
- return SrcInline(src_match, input_filepath, distribution)
-
- # TODO(glen): Make this regex not match src="" text that is not inside a tag
- flat_text = re.sub('src="(?P<filename>[^"\']*)"',
- SrcReplace,
- ReadFile(input_filename))
-
- # TODO(glen): Make this regex not match url('') that is not inside a style
- flat_text = re.sub('background:[ ]*url\(\'(?P<filename>[^"\']*)\'',
- SrcReplace,
- flat_text)
-
- out_file = open(output_filename, 'wb')
- out_file.writelines(flat_text)
- out_file.close()
-
-def main():
- if len(sys.argv) <= 2:
- print "Flattens a HTML file by inlining its external resources.\n"
- print "html_inline.py inputfile outputfile"
- else:
- InlineFile(sys.argv[1], sys.argv[2])
-
-if __name__ == '__main__':
- main()
-