diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-09 23:05:34 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-09 23:05:34 +0000 |
commit | 81fc9f01241ed5d635d35328fa226a682c7a81d2 (patch) | |
tree | 74b83b41373f3e6223461fb3bec44f43c799d599 | |
parent | 8fdf9f5214e385b650c1a708a5c7e015b8fbde5e (diff) | |
download | chromium_src-81fc9f01241ed5d635d35328fa226a682c7a81d2.zip chromium_src-81fc9f01241ed5d635d35328fa226a682c7a81d2.tar.gz chromium_src-81fc9f01241ed5d635d35328fa226a682c7a81d2.tar.bz2 |
Move AttributedStringCoder from chrome to content.
Also, move a few Mac-only files to the new content/commmon/mac.
BUG=95573
TEST=no change
Review URL: http://codereview.chromium.org/7867016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100526 0039d316-1c4b-4281-b951-d872f2087c98
19 files changed, 38 insertions, 39 deletions
diff --git a/chrome/browser/renderer_host/text_input_client_message_filter.h b/chrome/browser/renderer_host/text_input_client_message_filter.h index 99b682b..384b37a 100644 --- a/chrome/browser/renderer_host/text_input_client_message_filter.h +++ b/chrome/browser/renderer_host/text_input_client_message_filter.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_RENDERER_HOST_TEXT_INPUT_CLIENT_MESSAGE_FILTER_H_ #pragma once -#include "chrome/common/mac/attributed_string_coder.h" #include "content/browser/browser_message_filter.h" +#include "content/common/mac/attributed_string_coder.h" namespace gfx { class Rect; diff --git a/chrome/browser/renderer_host/text_input_client_message_filter.mm b/chrome/browser/renderer_host/text_input_client_message_filter.mm index 65dd9e2..fa7a10f 100644 --- a/chrome/browser/renderer_host/text_input_client_message_filter.mm +++ b/chrome/browser/renderer_host/text_input_client_message_filter.mm @@ -7,7 +7,6 @@ #include "base/memory/scoped_nsobject.h" #include "base/string16.h" #include "chrome/browser/renderer_host/text_input_client_mac.h" -#include "chrome/common/mac/attributed_string_coder.h" #include "chrome/common/text_input_client_messages.h" #include "content/browser/browser_thread.h" #include "content/browser/renderer_host/render_view_host.h" diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index eb8bbac..6ebc25b 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -202,8 +202,6 @@ 'common/jstemplate_builder.h', 'common/mac/app_mode_common.h', 'common/mac/app_mode_common.mm', - 'common/mac/attributed_string_coder.h', - 'common/mac/attributed_string_coder.mm', 'common/mac/cfbundle_blocker.h', 'common/mac/cfbundle_blocker.mm', 'common/mac/launchd.h', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 4e65acb..3a3a8fe 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1786,7 +1786,6 @@ 'common/json_schema_validator_unittest_base.h', 'common/json_value_serializer_unittest.cc', 'common/multi_process_lock_unittest.cc', - 'common/mac/attributed_string_coder_unittest.mm', 'common/mac/objc_method_swizzle_unittest.mm', 'common/mac/objc_zombie_unittest.mm', 'common/net/gaia/gaia_auth_fetcher_unittest.cc', diff --git a/chrome/common/text_input_client_messages.h b/chrome/common/text_input_client_messages.h index 5ed66ad..c42a32a 100644 --- a/chrome/common/text_input_client_messages.h +++ b/chrome/common/text_input_client_messages.h @@ -9,7 +9,7 @@ #include "ui/gfx/rect.h" #if defined(OS_MACOSX) -#include "chrome/common/mac/attributed_string_coder.h" +#include "content/common/mac/attributed_string_coder.h" #endif #define IPC_MESSAGE_START TextInputClientMsgStart diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 32180e3..f6e4547 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -59,8 +59,8 @@ #include "webkit/plugins/webplugininfo.h" #if defined(OS_MACOSX) -#include "content/common/font_descriptor_mac.h" -#include "content/common/font_loader_mac.h" +#include "content/common/mac/font_descriptor.h" +#include "content/common/mac/font_loader.h" #endif #if defined(OS_POSIX) #include "base/file_descriptor_posix.h" diff --git a/chrome/common/mac/attributed_string_coder.h b/content/common/mac/attributed_string_coder.h index bbaeb82..054cb45 100644 --- a/chrome/common/mac/attributed_string_coder.h +++ b/content/common/mac/attributed_string_coder.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_MAC_ATTRIBUTED_STRING_CODER_H_ -#define CHROME_COMMON_MAC_ATTRIBUTED_STRING_CODER_H_ +#ifndef CONTENT_COMMON_MAC_ATTRIBUTED_STRING_CODER_H_ +#define CONTENT_COMMON_MAC_ATTRIBUTED_STRING_CODER_H_ #pragma once #include <set> #include "base/memory/scoped_ptr.h" #include "base/string16.h" -#include "content/common/font_descriptor_mac.h" +#include "content/common/mac/font_descriptor.h" #include "ipc/ipc_message_utils.h" #include "ui/base/range/range.h" @@ -116,4 +116,4 @@ struct ParamTraits<mac::AttributedStringCoder::FontAttribute> { } // namespace IPC -#endif // CHROME_COMMON_MAC_ATTRIBUTED_STRING_CODER_H_ +#endif // CONTENT_COMMON_MAC_ATTRIBUTED_STRING_CODER_H_ diff --git a/chrome/common/mac/attributed_string_coder.mm b/content/common/mac/attributed_string_coder.mm index 7078f4b..ca4847d 100644 --- a/chrome/common/mac/attributed_string_coder.mm +++ b/content/common/mac/attributed_string_coder.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/mac/attributed_string_coder.h" +#include "content/common/mac/attributed_string_coder.h" #include <AppKit/AppKit.h> diff --git a/chrome/common/mac/attributed_string_coder_unittest.mm b/content/common/mac/attributed_string_coder_unittest.mm index b099a0f..993c842 100644 --- a/chrome/common/mac/attributed_string_coder_unittest.mm +++ b/content/common/mac/attributed_string_coder_unittest.mm @@ -7,7 +7,7 @@ #include "base/memory/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/utf_string_conversions.h" -#import "chrome/common/mac/attributed_string_coder.h" +#import "content/common/mac/attributed_string_coder.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest_mac.h" diff --git a/content/common/font_descriptor_mac.h b/content/common/mac/font_descriptor.h index c3ac5a8..750976f 100644 --- a/content/common/font_descriptor_mac.h +++ b/content/common/mac/font_descriptor.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_COMMON_FONT_DESCRIPTOR_MAC_H_ -#define CONTENT_COMMON_FONT_DESCRIPTOR_MAC_H_ +#ifndef CONTENT_COMMON_MAC_FONT_DESCRIPTOR_H_ +#define CONTENT_COMMON_MAC_FONT_DESCRIPTOR_H_ #pragma once #include "base/string16.h" @@ -31,4 +31,4 @@ struct FontDescriptor { float font_point_size; }; -#endif // CONTENT_COMMON_FONT_DESCRIPTOR_MAC_H_ +#endif // CONTENT_COMMON_MAC_FONT_DESCRIPTOR_H_ diff --git a/content/common/font_descriptor_mac.mm b/content/common/mac/font_descriptor.mm index c8e3112..65ab40e 100644 --- a/content/common/font_descriptor_mac.mm +++ b/content/common/mac/font_descriptor.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/common/font_descriptor_mac.h" +#include "content/common/mac/font_descriptor.h" #include <Cocoa/Cocoa.h> diff --git a/content/common/font_descriptor_mac_unittest.mm b/content/common/mac/font_descriptor_unittest.mm index f8fdfc8..7054c22 100644 --- a/content/common/font_descriptor_mac_unittest.mm +++ b/content/common/mac/font_descriptor_unittest.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/common/font_descriptor_mac.h" +#include "content/common/mac/font_descriptor.h" #include <Cocoa/Cocoa.h> @@ -24,7 +24,7 @@ const std::string kCourierFontName("Courier"); bool CompareFonts(NSFont* font1, NSFont* font2) { ATSFontRef id1 = CTFontGetPlatformFont(reinterpret_cast<CTFontRef>(font1), 0); ATSFontRef id2 = CTFontGetPlatformFont(reinterpret_cast<CTFontRef>(font2), 0); - + if (id1 != id2) { LOG(ERROR) << "ATSFontRefs for " << [[font1 fontName] UTF8String] @@ -33,7 +33,7 @@ bool CompareFonts(NSFont* font1, NSFont* font2) { << " are different"; return false; } - + CGFloat size1 = [font1 pointSize]; CGFloat size2 = [font2 pointSize]; if (size1 != size2) { @@ -49,12 +49,12 @@ bool CompareFonts(NSFont* font1, NSFont* font2) { traitsOfFont:font1]; NSFontTraitMask traits2 = [[NSFontManager sharedFontManager] traitsOfFont:font2]; - + bool is_bold1 = traits1 & NSBoldFontMask; bool is_bold2 = traits2 & NSBoldFontMask; bool is_italic1 = traits1 & NSItalicFontMask; bool is_italic2 = traits2 & NSItalicFontMask; - + if (is_bold1 != is_bold2 || is_italic1 != is_italic2) { LOG(ERROR) << "Style information for " << [[font1 fontName] UTF8String] @@ -63,7 +63,7 @@ bool CompareFonts(NSFont* font1, NSFont* font2) { << " are different"; return false; } - + return true; } @@ -82,12 +82,12 @@ TEST_F(FontSerializationTest, StyledFonts) { ASSERT_TRUE(plain_font != nil); FontDescriptor desc_plain(plain_font); EXPECT_TRUE(CompareFonts(plain_font, desc_plain.ToNSFont())); - + NSFont* bold_font = [NSFont boldSystemFontOfSize:30.0]; ASSERT_TRUE(bold_font != nil); FontDescriptor desc_bold(bold_font); EXPECT_TRUE(CompareFonts(bold_font, desc_bold.ToNSFont())); - + NSFont* italic_bold_font = [[NSFontManager sharedFontManager] fontWithFamily:base::SysUTF8ToNSString(kCourierFontName) diff --git a/content/common/font_loader_mac.h b/content/common/mac/font_loader.h index 410e076..7cd6682 100644 --- a/content/common/font_loader_mac.h +++ b/content/common/mac/font_loader.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_COMMON_FONT_LOADER_MAC_H_ -#define CONTENT_COMMON_FONT_LOADER_MAC_H_ +#ifndef CONTENT_COMMON_MAC_FONT_LOADER_H_ +#define CONTENT_COMMON_MAC_FONT_LOADER_H_ #pragma once #include <ApplicationServices/ApplicationServices.h> @@ -60,4 +60,4 @@ class FontLoader { ATSFontContainerRef* font_container); }; -#endif // CONTENT_COMMON_FONT_LOADER_MAC_H_ +#endif // CONTENT_COMMON_MAC_FONT_LOADER_H_ diff --git a/content/common/font_loader_mac.mm b/content/common/mac/font_loader.mm index 867e1d3..93eb03f 100644 --- a/content/common/font_loader_mac.mm +++ b/content/common/mac/font_loader.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/common/font_loader_mac.h" +#include "content/common/mac/font_loader.h" #import <Cocoa/Cocoa.h> diff --git a/content/common/sandbox_mac_fontloading_unittest.mm b/content/common/sandbox_mac_fontloading_unittest.mm index bca576d..911110f 100644 --- a/content/common/sandbox_mac_fontloading_unittest.mm +++ b/content/common/sandbox_mac_fontloading_unittest.mm @@ -9,7 +9,7 @@ #include "base/mac/scoped_cftyperef.h" #include "base/memory/scoped_ptr.h" #include "base/shared_memory.h" -#include "content/common/font_loader_mac.h" +#include "content/common/mac/font_loader.h" #include "content/common/sandbox_mac_unittest_helper.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/content/common/view_messages.h b/content/common/view_messages.h index 9a281f54..d127d71 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h @@ -40,7 +40,7 @@ #include "webkit/plugins/webplugininfo.h" #if defined(OS_MACOSX) -#include "content/common/font_descriptor_mac.h" +#include "content/common/mac/font_descriptor.h" #endif // Define enums used in this file inside an include-guard. diff --git a/content/content_common.gypi b/content/content_common.gypi index 1124ea2..2efc679 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -102,14 +102,10 @@ 'common/file_utilities_messages.h', 'common/font_config_ipc_linux.cc', 'common/font_config_ipc_linux.h', - 'common/font_descriptor_mac.h', - 'common/font_descriptor_mac.mm', 'common/font_list.h', 'common/font_list_gtk.cc', 'common/font_list_mac.mm', 'common/font_list_win.cc', - 'common/font_loader_mac.h', - 'common/font_loader_mac.mm', 'common/geolocation_messages.h', 'common/geoposition.cc', 'common/geoposition.h', @@ -141,6 +137,12 @@ 'common/indexed_db_param_traits.h', 'common/json_value_serializer.cc', 'common/json_value_serializer.h', + 'common/mac/attributed_string_coder.h', + 'common/mac/attributed_string_coder.mm', + 'common/mac/font_descriptor.h', + 'common/mac/font_descriptor.mm', + 'common/mac/font_loader.h', + 'common/mac/font_loader.mm', 'common/main_function_params.h', 'common/media/audio_messages.h', 'common/media/audio_stream_state.h', diff --git a/content/content_tests.gypi b/content/content_tests.gypi index e08ac4f..29e8809 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi @@ -121,7 +121,8 @@ 'browser/tab_contents/navigation_entry_unittest.cc', 'browser/tab_contents/tab_contents_delegate_unittest.cc', 'browser/trace_subscriber_stdio_unittest.cc', - 'common/font_descriptor_mac_unittest.mm', + 'common/mac/attributed_string_coder_unittest.mm', + 'common/mac/font_descriptor_unittest.mm', 'common/gpu/gpu_feature_flags_unittest.cc', 'common/gpu/gpu_info_unittest.cc', 'common/hi_res_timer_manager_unittest.cc', diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc index 512d2cb..7028743 100644 --- a/content/renderer/renderer_webkitplatformsupport_impl.cc +++ b/content/renderer/renderer_webkitplatformsupport_impl.cc @@ -51,8 +51,8 @@ #endif #if defined(OS_MACOSX) -#include "content/common/font_descriptor_mac.h" -#include "content/common/font_loader_mac.h" +#include "content/common/mac/font_descriptor.h" +#include "content/common/mac/font_loader.h" #include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebSandboxSupport.h" #endif |