| Index: ios/web_view/test/observers/observer.mm
|
| diff --git a/ios/web_view/test/boolean_observer.mm b/ios/web_view/test/observers/observer.mm
|
| similarity index 73%
|
| rename from ios/web_view/test/boolean_observer.mm
|
| rename to ios/web_view/test/observers/observer.mm
|
| index fc2b5f2dcd3cb873f01b2634f65db7f7e3e88db2..e5b4df7d311ab5be76ab73368c760744d1104e8f 100644
|
| --- a/ios/web_view/test/boolean_observer.mm
|
| +++ b/ios/web_view/test/observers/observer.mm
|
| @@ -2,30 +2,28 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#import "ios/web_view/test/boolean_observer.h"
|
| +#import "ios/web_view/test/observers/observer.h"
|
|
|
| #if !defined(__has_feature) || !__has_feature(objc_arc)
|
| #error "This file requires ARC support."
|
| #endif
|
|
|
| -@implementation BooleanObserver
|
| +@implementation Observer
|
|
|
| @synthesize keyPath = _keyPath;
|
| -@synthesize lastValue = _lastValue;
|
| +@synthesize lastRawValue = _lastRawValue;
|
| @synthesize object = _object;
|
|
|
| - (void)setObservedObject:(NSObject*)object keyPath:(NSString*)keyPath {
|
| [_object removeObserver:self forKeyPath:_keyPath];
|
|
|
| - _lastValue = nil;
|
| + _lastRawValue = nil;
|
| _keyPath = [keyPath copy];
|
| _object = object;
|
| - if (keyPath) {
|
| - [_object addObserver:self
|
| - forKeyPath:_keyPath
|
| - options:NSKeyValueObservingOptionNew
|
| - context:nil];
|
| - }
|
| + [_object addObserver:self
|
| + forKeyPath:_keyPath
|
| + options:NSKeyValueObservingOptionNew
|
| + context:nil];
|
| }
|
|
|
| - (void)observeValueForKeyPath:(NSString*)keyPath
|
| @@ -36,7 +34,7 @@
|
| // Ignore extraneous call from previous |_object| or |_keyPath|.
|
| return;
|
| }
|
| - _lastValue = change[NSKeyValueChangeNewKey];
|
| + _lastRawValue = change[NSKeyValueChangeNewKey];
|
| }
|
|
|
| - (void)dealloc {
|
|
|