| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ios/chrome/browser/ui/background_generator.h" | 5 #include "ios/chrome/browser/ui/background_generator.h" |
| 6 | 6 |
| 7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
| 8 #include <stddef.h> |
| 8 | 9 |
| 9 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
| 10 #include "base/mac/foundation_util.h" | 11 #include "base/mac/foundation_util.h" |
| 11 #include "base/mac/scoped_cftyperef.h" | 12 #include "base/mac/scoped_cftyperef.h" |
| 12 #import "base/mac/scoped_nsobject.h" | 13 #import "base/mac/scoped_nsobject.h" |
| 13 #import "ios/chrome/browser/ui/ui_util.h" | 14 #import "ios/chrome/browser/ui/ui_util.h" |
| 14 | 15 |
| 15 // This is a utility function that may be used as a standalone helper function | 16 // This is a utility function that may be used as a standalone helper function |
| 16 // to generate a radial gradient UIImage. | 17 // to generate a radial gradient UIImage. |
| 17 UIImage* GetRadialGradient(CGRect backgroundRect, | 18 UIImage* GetRadialGradient(CGRect backgroundRect, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 48 | 49 |
| 49 void InstallBackgroundInView(UIView* view) { | 50 void InstallBackgroundInView(UIView* view) { |
| 50 UIImageView* imageView = | 51 UIImageView* imageView = |
| 51 [[[UIImageView alloc] initWithFrame:view.bounds] autorelease]; | 52 [[[UIImageView alloc] initWithFrame:view.bounds] autorelease]; |
| 52 imageView.image = [UIImage imageNamed:@"stack_view_background_noise.jpg"]; | 53 imageView.image = [UIImage imageNamed:@"stack_view_background_noise.jpg"]; |
| 53 imageView.contentMode = UIViewContentModeScaleAspectFill; | 54 imageView.contentMode = UIViewContentModeScaleAspectFill; |
| 54 imageView.autoresizingMask = | 55 imageView.autoresizingMask = |
| 55 UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; | 56 UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; |
| 56 [view insertSubview:imageView atIndex:0]; | 57 [view insertSubview:imageView atIndex:0]; |
| 57 } | 58 } |
| OLD | NEW |