OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/mac/bundle_locations.h" |
| 6 #import "base/mac/foundation_util.h" |
| 7 #import "ios/chrome/browser/ui/native_content_controller.h" |
| 8 |
| 9 @implementation NativeContentController |
| 10 |
| 11 @synthesize view = view_; |
| 12 @synthesize title = title_; |
| 13 @synthesize url = url_; |
| 14 |
| 15 - (instancetype)initWithNibName:(NSString*)nibName url:(const GURL&)url { |
| 16 self = [super init]; |
| 17 if (self) { |
| 18 propertyReleaser_NativeContentController_.Init( |
| 19 self, [NativeContentController class]); |
| 20 [base::mac::FrameworkBundle() loadNibNamed:nibName owner:self options:nil]; |
| 21 url_ = url; |
| 22 } |
| 23 return self; |
| 24 } |
| 25 |
| 26 - (instancetype)initWithURL:(const GURL&)url { |
| 27 self = [super init]; |
| 28 if (self) { |
| 29 propertyReleaser_NativeContentController_.Init( |
| 30 self, [NativeContentController class]); |
| 31 url_ = url; |
| 32 } |
| 33 return self; |
| 34 } |
| 35 |
| 36 - (void)dealloc { |
| 37 [view_ removeFromSuperview]; |
| 38 [super dealloc]; |
| 39 } |
| 40 |
| 41 - (void)handleLowMemory { |
| 42 // TODO(pinkerton): What should this do? Toss the view? |
| 43 } |
| 44 |
| 45 - (BOOL)isViewAlive { |
| 46 // TODO(pinkerton): See handleLowMemory above. |
| 47 return YES; |
| 48 } |
| 49 |
| 50 - (void)reload { |
| 51 // Not implemented in base class. |
| 52 } |
| 53 |
| 54 @end |
OLD | NEW |