OLD | NEW |
| (Empty) |
1 // Copyright 2016 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 #import "ios/web/public/test/test_native_content.h" | |
6 | |
7 #import "base/mac/scoped_nsobject.h" | |
8 | |
9 @implementation TestNativeContent { | |
10 GURL _URL; | |
11 GURL _virtualURL; | |
12 base::scoped_nsobject<UIView> _view; | |
13 } | |
14 - (instancetype)initWithURL:(const GURL&)URL | |
15 virtualURL:(const GURL&)virtualURL { | |
16 self = [super init]; | |
17 if (self) { | |
18 _URL = URL; | |
19 _virtualURL = virtualURL; | |
20 } | |
21 return self; | |
22 } | |
23 | |
24 - (BOOL)respondsToSelector:(SEL)selector { | |
25 if (selector == @selector(virtualURL)) { | |
26 return _virtualURL.is_valid(); | |
27 } | |
28 return [super respondsToSelector:selector]; | |
29 } | |
30 | |
31 - (NSString*)title { | |
32 return @"Test Title"; | |
33 } | |
34 | |
35 - (const GURL&)url { | |
36 return _URL; | |
37 } | |
38 | |
39 - (GURL)virtualURL { | |
40 return _virtualURL; | |
41 } | |
42 | |
43 - (UIView*)view { | |
44 return nil; | |
45 } | |
46 | |
47 - (void)handleLowMemory { | |
48 } | |
49 | |
50 - (BOOL)isViewAlive { | |
51 return YES; | |
52 } | |
53 | |
54 - (void)reload { | |
55 } | |
56 @end | |
OLD | NEW |