diff options
author | gregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-07 21:16:38 +0000 |
---|---|---|
committer | gregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-07 21:16:38 +0000 |
commit | dcf3c878a87776d20f021d9bbd2b4f3b09fbb44e (patch) | |
tree | 32c3ecd4c21c74fa6b54f78630fe10271e13cbaa /app | |
parent | f5cf88a21918e04a52c9aa7fc8e13ff24b7bf196 (diff) | |
download | chromium_src-dcf3c878a87776d20f021d9bbd2b4f3b09fbb44e.zip chromium_src-dcf3c878a87776d20f021d9bbd2b4f3b09fbb44e.tar.gz chromium_src-dcf3c878a87776d20f021d9bbd2b4f3b09fbb44e.tar.bz2 |
Split app.gyp and add a Win64 version of the app_base target.
This is required for supporting NaCl on 64-bit Windows
TEST=none
BUG=28176
Review URL: http://codereview.chromium.org/460083
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r-- | app/app.gyp | 212 | ||||
-rw-r--r-- | app/app_base.gypi | 280 | ||||
-rw-r--r-- | app/l10n_util_dummy.cc | 27 | ||||
-rw-r--r-- | app/resource_bundle_dummy.cc | 58 |
4 files changed, 368 insertions, 209 deletions
diff --git a/app/app.gyp b/app/app.gyp index 64f652a..8984fa8 100644 --- a/app/app.gyp +++ b/app/app.gyp @@ -15,217 +15,11 @@ 'resources/app_strings.grd', ], }, + 'includes': [ + 'app_base.gypi', + ], 'targets': [ { - 'target_name': 'app_base', - 'type': '<(library)', - 'msvs_guid': '4631946D-7D5F-44BD-A5A8-504C0A7033BE', - 'dependencies': [ - 'app_resources', - 'app_strings', - '../base/base.gyp:base', - '../base/base.gyp:base_i18n', - '../net/net.gyp:net', - '../skia/skia.gyp:skia', - '../third_party/icu/icu.gyp:icui18n', - '../third_party/icu/icu.gyp:icuuc', - '../third_party/libjpeg/libjpeg.gyp:libjpeg', - '../third_party/libpng/libpng.gyp:libpng', - '../third_party/sqlite/sqlite.gyp:sqlite', - '../third_party/zlib/zlib.gyp:zlib', - ], - 'include_dirs': [ - '..', - '../chrome/third_party/wtl/include', - ], - 'sources': [ - # All .cc, .h, and .mm files under app/ except for tests. - 'animation.cc', - 'animation.h', - 'active_window_watcher_x.cc', - 'active_window_watcher_x.h', - 'app_paths.h', - 'app_paths.cc', - 'app_switches.h', - 'app_switches.cc', - 'clipboard/clipboard.cc', - 'clipboard/clipboard.h', - 'clipboard/clipboard_linux.cc', - 'clipboard/clipboard_mac.mm', - 'clipboard/clipboard_util_win.cc', - 'clipboard/clipboard_util_win.h', - 'clipboard/clipboard_win.cc', - 'clipboard/scoped_clipboard_writer.cc', - 'clipboard/scoped_clipboard_writer.h', - 'combobox_model.h', - 'drag_drop_types_gtk.cc', - 'drag_drop_types_win.cc', - 'drag_drop_types.h', - 'gfx/blit.cc', - 'gfx/blit.h', - 'gfx/canvas.cc', - 'gfx/canvas.h', - 'gfx/canvas_linux.cc', - 'gfx/canvas_mac.mm', - 'gfx/canvas_win.cc', - 'gfx/codec/jpeg_codec.cc', - 'gfx/codec/jpeg_codec.h', - 'gfx/codec/png_codec.cc', - 'gfx/codec/png_codec.h', - 'gfx/color_utils.cc', - 'gfx/color_utils.h', - 'gfx/favicon_size.h', - 'gfx/font.h', - 'gfx/font_gtk.cc', - 'gfx/font_mac.mm', - 'gfx/font_skia.cc', - 'gfx/font_util.h', - 'gfx/font_util.cc', - 'gfx/font_win.cc', - 'gfx/gdi_util.cc', - 'gfx/gdi_util.h', - 'gfx/gtk_util.cc', - 'gfx/gtk_util.h', - 'gfx/icon_util.cc', - 'gfx/icon_util.h', - 'gfx/insets.h', - 'gfx/native_widget_types.h', - 'gfx/native_widget_types_gtk.cc', - 'gfx/native_theme_win.cc', - 'gfx/native_theme_win.h', - 'gfx/gtk_native_view_id_manager.cc', - 'gfx/gtk_native_view_id_manager.h', - 'gfx/path.cc', - 'gfx/path_gtk.cc', - 'gfx/path_win.cc', - 'gfx/path.h', - 'gfx/skbitmap_operations.cc', - 'gfx/skbitmap_operations.h', - 'gfx/text_elider.cc', - 'gfx/text_elider.h', - 'gtk_dnd_util.cc', - 'gtk_dnd_util.h', - 'hi_res_timer_manager_posix.cc', - 'hi_res_timer_manager_win.cc', - 'hi_res_timer_manager.h', - 'l10n_util.cc', - 'l10n_util.h', - 'l10n_util_mac.h', - 'l10n_util_mac.mm', - 'l10n_util_posix.cc', - 'l10n_util_win.cc', - 'l10n_util_win.h', - 'menus/accelerator.h', - 'menus/menu_model.cc', - 'menus/menu_model.h', - 'menus/simple_menu_model.cc', - 'menus/simple_menu_model.h', - 'message_box_flags.h', - 'os_exchange_data_provider_gtk.cc', - 'os_exchange_data_provider_gtk.h', - 'os_exchange_data_provider_win.cc', - 'os_exchange_data_provider_win.h', - 'os_exchange_data.cc', - 'os_exchange_data.h', - 'resource_bundle.cc', - 'resource_bundle.h', - 'resource_bundle_linux.cc', - 'resource_bundle_mac.mm', - 'resource_bundle_posix.cc', - 'resource_bundle_win.cc', - 'slide_animation.cc', - 'slide_animation.h', - 'sql/connection.cc', - 'sql/connection.h', - 'sql/meta_table.cc', - 'sql/meta_table.h', - 'sql/statement.cc', - 'sql/statement.h', - 'sql/transaction.cc', - 'sql/transaction.h', - 'system_monitor.cc', - 'system_monitor.h', - 'system_monitor_posix.cc', - 'system_monitor_win.cc', - 'table_model.cc', - 'table_model.h', - 'table_model_observer.h', - 'theme_provider.cc', - 'theme_provider.h', - 'throb_animation.cc', - 'throb_animation.h', - 'tree_model.h', - 'tree_node_iterator.h', - 'tree_node_model.h', - 'win/window_impl.cc', - 'win/window_impl.h', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '..', - ], - }, - 'conditions': [ - ['OS=="linux"', { - 'dependencies': [ - # font_gtk.cc uses fontconfig. - # TODO(evanm): I think this is wrong; it should just use GTK. - '../build/linux/system.gyp:fontconfig', - '../build/linux/system.gyp:gtk', - '../build/linux/system.gyp:x11', - ], - 'conditions': [ - ['toolkit_views==0 and chromeos==0', { - # Note: because of gyp predence rules this has to be defined as - # 'sources/' rather than 'sources!'. - 'sources/': [ - ['exclude', '^os_exchange_data.cc'], - ['exclude', '^os_exchange_data.h'], - ['exclude', '^os_exchange_data_provider_gtk.cc'], - ['exclude', '^os_exchange_data_provider_gtk.h'], - ['exclude', '^drag_drop_types_gtk.cc'], - ], - }], - ['toolkit_views==1 or chromeos==1', { - # Note: because of gyp predence rules this has to be defined as - # 'sources/' rather than 'sources!'. - 'sources/': [ - ['include', '^os_exchange_data.cc'], - ], - }], - ], - }], - ['OS=="win"', { - 'sources': [ - 'win_util.cc', - 'win_util.h', - ], - }], - ['OS!="win"', { - 'sources!': [ - 'drag_drop_types.h', - 'gfx/gdi_util.cc', - 'gfx/gdi_util.h', - 'gfx/icon_util.cc', - 'gfx/icon_util.h', - 'gfx/native_theme_win.cc', - 'gfx/native_theme_win.h', - 'os_exchange_data.cc', - 'win/window_impl.cc', - 'win/window_impl.h', - ], - }], - ['OS!="linux"', { - 'sources!': [ - 'gfx/gtk_util.cc', - 'gfx/gtk_util.h', - 'gtk_dnd_util.cc', - 'gtk_dnd_util.h', - ], - }], - ], - }, - { 'target_name': 'app_unittests', 'type': 'executable', 'msvs_guid': 'B4D59AE8-8D2F-97E1-A8E9-6D2826729530', diff --git a/app/app_base.gypi b/app/app_base.gypi new file mode 100644 index 0000000..e3be85a --- /dev/null +++ b/app/app_base.gypi @@ -0,0 +1,280 @@ +# Copyright (c) 2009 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. + +{ + 'target_defaults': { + 'variables': { + 'app_base_target': 0, + }, + 'target_conditions': [ + # This part is shared between the targets defined below. Only files and + # settings relevant for building the Win64 target should be added here. + # All the rest should be added to the 'app_base' target below. + ['app_base_target==1', { + 'sources': [ + # Used both for Chrome and for Win64 NaCl loader + 'app_paths.h', + 'app_paths.cc', + 'app_switches.h', + 'app_switches.cc', + 'hi_res_timer_manager_posix.cc', + 'hi_res_timer_manager_win.cc', + 'hi_res_timer_manager.h', + 'system_monitor.cc', + 'system_monitor.h', + 'system_monitor_posix.cc', + 'system_monitor_win.cc', + 'tree_model.h', + 'tree_node_iterator.h', + 'tree_node_model.h', + 'win/window_impl.cc', + 'win/window_impl.h', + ], + 'include_dirs': [ + '..', + '../chrome/third_party/wtl/include', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '..', + ], + }, + 'conditions': [ + ['OS=="win"', { + 'sources': [ + 'win_util.cc', + 'win_util.h', + ], + }], + ['OS!="linux"', { + 'sources!': [ + 'gfx/gtk_util.cc', + 'gfx/gtk_util.h', + 'gtk_dnd_util.cc', + 'gtk_dnd_util.h', + ], + }], + ], + }], + ], + }, + 'targets': [ + { + 'target_name': 'app_base', + 'type': '<(library)', + 'msvs_guid': '4631946D-7D5F-44BD-A5A8-504C0A7033BE', + 'variables': { + 'app_base_target': 1, + }, + 'dependencies': [ + # app resources and app_strings should be shared with the 64-bit + # target, but it doesn't work due to a bug in gyp + 'app_resources', + 'app_strings', + '../base/base.gyp:base', + '../base/base.gyp:base_i18n', + '../net/net.gyp:net', + '../skia/skia.gyp:skia', + '../third_party/icu/icu.gyp:icui18n', + '../third_party/icu/icu.gyp:icuuc', + '../third_party/libjpeg/libjpeg.gyp:libjpeg', + '../third_party/libpng/libpng.gyp:libpng', + '../third_party/sqlite/sqlite.gyp:sqlite', + '../third_party/zlib/zlib.gyp:zlib', + ], + 'sources': [ + # Files that are not required for Win64 Native Client loader + 'animation.cc', + 'animation.h', + 'active_window_watcher_x.cc', + 'active_window_watcher_x.h', + 'clipboard/clipboard.cc', + 'clipboard/clipboard.h', + 'clipboard/clipboard_linux.cc', + 'clipboard/clipboard_mac.mm', + 'clipboard/clipboard_util_win.cc', + 'clipboard/clipboard_util_win.h', + 'clipboard/clipboard_win.cc', + 'clipboard/scoped_clipboard_writer.cc', + 'clipboard/scoped_clipboard_writer.h', + 'combobox_model.h', + 'drag_drop_types_gtk.cc', + 'drag_drop_types_win.cc', + 'drag_drop_types.h', + 'gfx/blit.cc', + 'gfx/blit.h', + 'gfx/canvas.cc', + 'gfx/canvas.h', + 'gfx/canvas_linux.cc', + 'gfx/canvas_mac.mm', + 'gfx/canvas_win.cc', + 'gfx/codec/jpeg_codec.cc', + 'gfx/codec/jpeg_codec.h', + 'gfx/codec/png_codec.cc', + 'gfx/codec/png_codec.h', + 'gfx/color_utils.cc', + 'gfx/color_utils.h', + 'gfx/favicon_size.h', + 'gfx/font.h', + 'gfx/font_gtk.cc', + 'gfx/font_mac.mm', + 'gfx/font_skia.cc', + 'gfx/font_util.h', + 'gfx/font_util.cc', + 'gfx/font_win.cc', + 'gfx/gdi_util.cc', + 'gfx/gdi_util.h', + 'gfx/gtk_util.cc', + 'gfx/gtk_util.h', + 'gfx/icon_util.cc', + 'gfx/icon_util.h', + 'gfx/insets.h', + 'gfx/native_widget_types.h', + 'gfx/native_widget_types_gtk.cc', + 'gfx/native_theme_win.cc', + 'gfx/native_theme_win.h', + 'gfx/gtk_native_view_id_manager.cc', + 'gfx/gtk_native_view_id_manager.h', + 'gfx/path.cc', + 'gfx/path_gtk.cc', + 'gfx/path_win.cc', + 'gfx/path.h', + 'gfx/skbitmap_operations.cc', + 'gfx/skbitmap_operations.h', + 'gfx/text_elider.cc', + 'gfx/text_elider.h', + 'gtk_dnd_util.cc', + 'gtk_dnd_util.h', + 'l10n_util.cc', + 'l10n_util.h', + 'l10n_util_mac.h', + 'l10n_util_mac.mm', + 'l10n_util_posix.cc', + 'l10n_util_win.cc', + 'l10n_util_win.h', + 'menus/accelerator.h', + 'menus/menu_model.cc', + 'menus/menu_model.h', + 'menus/simple_menu_model.cc', + 'menus/simple_menu_model.h', + 'message_box_flags.h', + 'os_exchange_data_provider_gtk.cc', + 'os_exchange_data_provider_gtk.h', + 'os_exchange_data_provider_win.cc', + 'os_exchange_data_provider_win.h', + 'os_exchange_data.cc', + 'os_exchange_data.h', + 'resource_bundle.cc', + 'resource_bundle.h', + 'resource_bundle_linux.cc', + 'resource_bundle_mac.mm', + 'resource_bundle_posix.cc', + 'resource_bundle_win.cc', + 'slide_animation.cc', + 'slide_animation.h', + 'sql/connection.cc', + 'sql/connection.h', + 'sql/meta_table.cc', + 'sql/meta_table.h', + 'sql/statement.cc', + 'sql/statement.h', + 'sql/transaction.cc', + 'sql/transaction.h', + 'table_model.cc', + 'table_model.h', + 'table_model_observer.h', + 'theme_provider.cc', + 'theme_provider.h', + 'throb_animation.cc', + 'throb_animation.h', + ], + 'conditions': [ + ['OS=="linux"', { + 'dependencies': [ + # font_gtk.cc uses fontconfig. + # TODO(evanm): I think this is wrong; it should just use GTK. + '../build/linux/system.gyp:fontconfig', + '../build/linux/system.gyp:gtk', + '../build/linux/system.gyp:x11', + ], + 'conditions': [ + ['toolkit_views==0 and chromeos==0', { + # Note: because of gyp predence rules this has to be defined as + # 'sources/' rather than 'sources!'. + 'sources/': [ + ['exclude', '^os_exchange_data.cc'], + ['exclude', '^os_exchange_data.h'], + ['exclude', '^os_exchange_data_provider_gtk.cc'], + ['exclude', '^os_exchange_data_provider_gtk.h'], + ['exclude', '^drag_drop_types_gtk.cc'], + ], + }], + ['toolkit_views==1 or chromeos==1', { + # Note: because of gyp predence rules this has to be defined as + # 'sources/' rather than 'sources!'. + 'sources/': [ + ['include', '^os_exchange_data.cc'], + ], + }], + ], + }], + ['OS!="win"', { + 'sources!': [ + 'drag_drop_types.h', + 'gfx/gdi_util.cc', + 'gfx/gdi_util.h', + 'gfx/icon_util.cc', + 'gfx/icon_util.h', + 'gfx/native_theme_win.cc', + 'gfx/native_theme_win.h', + 'os_exchange_data.cc', + 'win/window_impl.cc', + 'win/window_impl.h', + ], + }], + ], + }, + ], + 'conditions': [ + ['OS=="win"', { + 'targets': [ + { + 'target_name': 'app_base_nacl_win64', + 'type': '<(library)', + 'msvs_guid': '4987C6F9-B230-48E5-BF91-418EAE69AD90', + 'dependencies': [ + # app resources and app_strings should be shared with the 32-bit + # target, but it doesn't work due to a bug in gyp + 'app_resources', + 'app_strings', + '../base/base.gyp:base_nacl_win64', + ], + 'variables': { + 'app_base_target': 1, + }, + 'defines': [ + '<@(nacl_win64_defines)', + ], + 'sources': [ + 'l10n_util_dummy.cc', + 'resource_bundle_dummy.cc', + ], + 'include_dirs': [ + '../skia/config/win', + '../third_party/icu/public/common', + '../third_party/icu/public/i18n', + '../third_party/npapi', + '../third_party/skia/include/config', + '../third_party/skia/include/core', + ], + 'configurations': { + 'Common': { + 'msvs_target_platform': 'x64', + }, + }, + }, + ], + }], + ], +} diff --git a/app/l10n_util_dummy.cc b/app/l10n_util_dummy.cc new file mode 100644 index 0000000..749ecb4 --- /dev/null +++ b/app/l10n_util_dummy.cc @@ -0,0 +1,27 @@ +// 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. + +#include "app/l10n_util.h" + +#include "app/resource_bundle.h" +#include "base/command_line.h" +#include "base/string16.h" +#include "base/string_piece.h" +#include "base/string_util.h" +#include "base/sys_string_conversions.h" +#include "build/build_config.h" +#include "unicode/uscript.h" + + +namespace l10n_util { + +// Represents the locale-specific text direction. +static TextDirection g_text_direction = UNKNOWN_DIRECTION; + +std::wstring GetString(int message_id) { + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); + return UTF16ToWide(rb.GetLocalizedString(message_id)); +} + +} // namespace l10n_util diff --git a/app/resource_bundle_dummy.cc b/app/resource_bundle_dummy.cc new file mode 100644 index 0000000..77479f6 --- /dev/null +++ b/app/resource_bundle_dummy.cc @@ -0,0 +1,58 @@ +// Copyright (c) 2006-2009 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. + +#include "app/resource_bundle.h" + +#include <atlbase.h> +#include <windows.h> + +#include "app/gfx/font.h" +#include "base/logging.h" +#include "base/win_util.h" + +ResourceBundle* ResourceBundle::g_shared_instance_ = NULL; + +// NOTE(gregoryd): This is a hack to avoid creating more nacl_win64-specific +// files. The font members of ResourceBundle are never initialized in our code +// so this destructor is never called. +namespace gfx { + Font::HFontRef::~HFontRef() { + NOTREACHED(); + } +} + + +/* static */ +void ResourceBundle::InitSharedInstance(const std::wstring& pref_locale) { + DCHECK(g_shared_instance_ == NULL) << "ResourceBundle initialized twice"; + g_shared_instance_ = new ResourceBundle(); +} + +/* static */ +void ResourceBundle::CleanupSharedInstance() { + if (g_shared_instance_) { + delete g_shared_instance_; + g_shared_instance_ = NULL; + } +} + +/* static */ +ResourceBundle& ResourceBundle::GetSharedInstance() { + // Must call InitSharedInstance before this function. + CHECK(g_shared_instance_ != NULL); + return *g_shared_instance_; +} + +ResourceBundle::ResourceBundle() + : resources_data_(NULL), + locale_resources_data_(NULL) { +} + +ResourceBundle::~ResourceBundle() { +} + + +string16 ResourceBundle::GetLocalizedString(int message_id) { + return std::wstring(); +} |