diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-24 22:51:46 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-24 22:51:46 +0000 |
commit | a852203c1ae878c97ef5f64eec9b89e57642a78b (patch) | |
tree | 8d2e4837f0bd6f9300a0fe2d17c0956181e39bbf /ui/gfx | |
parent | dd9cd303480e5c1fd2465986903856651bded8d5 (diff) | |
download | chromium_src-a852203c1ae878c97ef5f64eec9b89e57642a78b.zip chromium_src-a852203c1ae878c97ef5f64eec9b89e57642a78b.tar.gz chromium_src-a852203c1ae878c97ef5f64eec9b89e57642a78b.tar.bz2 |
mac: Update clients of scoped_nsobject.h.
1.) The header is now in base/mac instead of base/memory
2.) The class is now in namespace base.
This CL was created programmatically by running:
1.)
git grep -l memory/scoped_nsobject.h | xargs sed -i -e 's/memory\/scoped_nsobject.h/mac\/scoped_nsobject.h/g'
for f in $(git diff --name-only origin); do tools/sort-headers.py $f -f; done
git commit -a -m headers
# manually undo changes to gypi file
git cl upload # patch set 1
2.)
git grep -l 'scoped_nsobject<' | xargs sed -i -e 's/scoped_nsobject</base::scoped_nsobject</g'
# manually undo comment changes in scoped_nsobject.h, tracking_area.h
git commit -a -m format
git cl upload # patch set 2
# Manually audit all files, file bugs and clean up bad clang-format decisions
git cl upload # patch set 3
BUG=251957
TBR=mark@chromium.org
Review URL: https://codereview.chromium.org/17593006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208283 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r-- | ui/gfx/image/image_ios.mm | 8 | ||||
-rw-r--r-- | ui/gfx/image/image_mac.mm | 12 | ||||
-rw-r--r-- | ui/gfx/image/image_mac_unittest.mm | 6 | ||||
-rw-r--r-- | ui/gfx/image/image_skia_util_mac.mm | 6 | ||||
-rw-r--r-- | ui/gfx/platform_font_mac.mm | 4 |
5 files changed, 18 insertions, 18 deletions
diff --git a/ui/gfx/image/image_ios.mm b/ui/gfx/image/image_ios.mm index e2ff8dc..01a3c87 100644 --- a/ui/gfx/image/image_ios.mm +++ b/ui/gfx/image/image_ios.mm @@ -4,13 +4,13 @@ #include "ui/gfx/image/image.h" +#import <UIKit/UIKit.h> #include <cmath> #include <limits> -#import <UIKit/UIKit.h> #include "base/logging.h" #include "base/mac/scoped_cftyperef.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "ui/base/layout.h" #include "ui/gfx/image/image_png_rep.h" #include "ui/gfx/image/image_skia.h" @@ -117,8 +117,8 @@ ImageSkia* ImageSkiaFromPNG( // through UIImage. gfx::ImageSkia* image_skia = new gfx::ImageSkia(); for (size_t i = 0; i < image_png_reps.size(); ++i) { - scoped_nsobject<UIImage> uiimage(CreateUIImageFromImagePNGRep( - image_png_reps[i])); + base::scoped_nsobject<UIImage> uiimage( + CreateUIImageFromImagePNGRep(image_png_reps[i])); gfx::ImageSkiaRep image_skia_rep = ImageSkiaRepOfScaleFactorFromUIImage( uiimage, image_png_reps[i].scale_factor); if (!image_skia_rep.is_null()) diff --git a/ui/gfx/image/image_mac.mm b/ui/gfx/image/image_mac.mm index 0158521..d03b48e 100644 --- a/ui/gfx/image/image_mac.mm +++ b/ui/gfx/image/image_mac.mm @@ -7,7 +7,7 @@ #import <AppKit/AppKit.h> #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "ui/gfx/image/image_png_rep.h" #include "ui/gfx/size.h" @@ -36,7 +36,7 @@ scoped_refptr<base::RefCountedMemory> Get1xPNGBytesFromNSImage( CGImageRef cg_image = [nsimage CGImageForProposedRect:NULL context:nil hints:nil]; - scoped_nsobject<NSBitmapImageRep> ns_bitmap( + base::scoped_nsobject<NSBitmapImageRep> ns_bitmap( [[NSBitmapImageRep alloc] initWithCGImage:cg_image]); NSData* ns_data = [ns_bitmap representationUsingType:NSPNGFileType properties:nil]; @@ -55,13 +55,13 @@ NSImage* NSImageFromPNG(const std::vector<gfx::ImagePNGRep>& image_png_reps, return GetErrorNSImage(); } - scoped_nsobject<NSImage> image; + base::scoped_nsobject<NSImage> image; for (size_t i = 0; i < image_png_reps.size(); ++i) { scoped_refptr<base::RefCountedMemory> png = image_png_reps[i].raw_data; CHECK(png.get()); - scoped_nsobject<NSData> ns_data( + base::scoped_nsobject<NSData> ns_data( [[NSData alloc] initWithBytes:png->front() length:png->size()]); - scoped_nsobject<NSBitmapImageRep> ns_image_rep( + base::scoped_nsobject<NSBitmapImageRep> ns_image_rep( [[NSBitmapImageRep alloc] initWithData:ns_data]); if (!ns_image_rep) { LOG(ERROR) << "Unable to decode PNG at " @@ -78,7 +78,7 @@ NSImage* NSImageFromPNG(const std::vector<gfx::ImagePNGRep>& image_png_reps, [[ns_image_rep colorSpace] CGColorSpace]); CGColorSpaceModel color_space_model = CGColorSpaceGetModel(color_space); if (decoded_color_space_model == color_space_model) { - scoped_nsobject<NSColorSpace> ns_color_space( + base::scoped_nsobject<NSColorSpace> ns_color_space( [[NSColorSpace alloc] initWithCGColorSpace:color_space]); NSBitmapImageRep* ns_retagged_image_rep = [ns_image_rep diff --git a/ui/gfx/image/image_mac_unittest.mm b/ui/gfx/image/image_mac_unittest.mm index 7a0c3eb..250deeb 100644 --- a/ui/gfx/image/image_mac_unittest.mm +++ b/ui/gfx/image/image_mac_unittest.mm @@ -5,7 +5,7 @@ #include <Cocoa/Cocoa.h> #include "base/logging.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/image/image.h" #include "ui/gfx/image/image_png_rep.h" @@ -99,7 +99,7 @@ TEST_F(ImageMacTest, MultiResolutionNSImageToImageSkia) { BitmapImageRep(kWidth1x, kHeight1x, &ns_image_rep1); NSBitmapImageRep* ns_image_rep2; BitmapImageRep(kWidth2x, kHeight2x, &ns_image_rep2); - scoped_nsobject<NSImage> ns_image( + base::scoped_nsobject<NSImage> ns_image( [[NSImage alloc] initWithSize:NSMakeSize(kWidth1x, kHeight1x)]); [ns_image addRepresentation:ns_image_rep1]; [ns_image addRepresentation:ns_image_rep2]; @@ -131,7 +131,7 @@ TEST_F(ImageMacTest, UnalignedMultiResolutionNSImageToImageSkia) { NSBitmapImageRep* ns_image_rep4; BitmapImageRep(kWidth4x, kHeight4x, &ns_image_rep4); - scoped_nsobject<NSImage> ns_image( + base::scoped_nsobject<NSImage> ns_image( [[NSImage alloc] initWithSize:NSMakeSize(kWidth1x, kHeight1x)]); [ns_image addRepresentation:ns_image_rep4]; diff --git a/ui/gfx/image/image_skia_util_mac.mm b/ui/gfx/image/image_skia_util_mac.mm index 226953b..f9d0475 100644 --- a/ui/gfx/image/image_skia_util_mac.mm +++ b/ui/gfx/image/image_skia_util_mac.mm @@ -10,7 +10,7 @@ #import <AppKit/AppKit.h> #include "base/mac/mac_util.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "skia/ext/skia_utils_mac.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -89,7 +89,7 @@ NSImage* NSImageFromImageSkia(const gfx::ImageSkia& image_skia) { if (image_skia.isNull()) return nil; - scoped_nsobject<NSImage> image([[NSImage alloc] init]); + base::scoped_nsobject<NSImage> image([[NSImage alloc] init]); image_skia.EnsureRepsForSupportedScaleFactors(); std::vector<gfx::ImageSkiaRep> image_reps = image_skia.image_reps(); for (std::vector<gfx::ImageSkiaRep>::const_iterator it = image_reps.begin(); @@ -107,7 +107,7 @@ NSImage* NSImageFromImageSkiaWithColorSpace(const gfx::ImageSkia& image_skia, if (image_skia.isNull()) return nil; - scoped_nsobject<NSImage> image([[NSImage alloc] init]); + base::scoped_nsobject<NSImage> image([[NSImage alloc] init]); image_skia.EnsureRepsForSupportedScaleFactors(); std::vector<gfx::ImageSkiaRep> image_reps = image_skia.image_reps(); for (std::vector<gfx::ImageSkiaRep>::const_iterator it = image_reps.begin(); diff --git a/ui/gfx/platform_font_mac.mm b/ui/gfx/platform_font_mac.mm index eff0c0f..bf0c0bd 100644 --- a/ui/gfx/platform_font_mac.mm +++ b/ui/gfx/platform_font_mac.mm @@ -7,7 +7,7 @@ #include <Cocoa/Cocoa.h> #include "base/basictypes.h" -#include "base/memory/scoped_nsobject.h" +#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "ui/gfx/canvas.h" @@ -124,7 +124,7 @@ void PlatformFontMac::InitWithNameSizeAndStyle(const std::string& font_name, void PlatformFontMac::CalculateMetrics() { NSFont* font = GetNativeFont(); - scoped_nsobject<NSLayoutManager> layout_manager( + base::scoped_nsobject<NSLayoutManager> layout_manager( [[NSLayoutManager alloc] init]); height_ = [layout_manager defaultLineHeightForFont:font]; ascent_ = [font ascender]; |