| 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 #import "ios/chrome/browser/xcallback_parameters.h" | 5 #import "ios/chrome/browser/xcallback_parameters.h" |
| 6 | 6 |
| 7 #include "base/logging.h" |
| 7 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 9 | 10 |
| 10 namespace { | 11 namespace { |
| 11 NSString* const kSourceAppIdKey = @"sourceAppId"; | 12 NSString* const kSourceAppIdKey = @"sourceAppId"; |
| 12 NSString* const kSourceAppNameKey = @"sourceAppName"; | 13 NSString* const kSourceAppNameKey = @"sourceAppName"; |
| 13 NSString* const kSuccessURLKey = @"successURL"; | 14 NSString* const kSuccessURLKey = @"successURL"; |
| 14 NSString* const kCreateNewTabKey = @"createNewTab"; | 15 NSString* const kCreateNewTabKey = @"createNewTab"; |
| 15 } | 16 } |
| 16 | 17 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 34 self = [super init]; | 35 self = [super init]; |
| 35 if (self) { | 36 if (self) { |
| 36 _sourceAppId.reset([sourceAppId copy]); | 37 _sourceAppId.reset([sourceAppId copy]); |
| 37 _sourceAppName.reset([sourceAppName copy]); | 38 _sourceAppName.reset([sourceAppName copy]); |
| 38 _successURL = successURL; | 39 _successURL = successURL; |
| 39 _createNewTab = createNewTab; | 40 _createNewTab = createNewTab; |
| 40 } | 41 } |
| 41 return self; | 42 return self; |
| 42 } | 43 } |
| 43 | 44 |
| 45 - (instancetype)init { |
| 46 NOTREACHED(); |
| 47 return nil; |
| 48 } |
| 49 |
| 44 - (NSString*)description { | 50 - (NSString*)description { |
| 45 return [NSString stringWithFormat:@"SourceApp: %@ (%@)\nSuccessURL: %s\n", | 51 return [NSString stringWithFormat:@"SourceApp: %@ (%@)\nSuccessURL: %s\n", |
| 46 _sourceAppName.get(), _sourceAppId.get(), | 52 _sourceAppName.get(), _sourceAppId.get(), |
| 47 _successURL.spec().c_str()]; | 53 _successURL.spec().c_str()]; |
| 48 } | 54 } |
| 49 | 55 |
| 50 - (NSString*)sourceAppId { | 56 - (NSString*)sourceAppId { |
| 51 return _sourceAppId.get(); | 57 return _sourceAppId.get(); |
| 52 } | 58 } |
| 53 | 59 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 - (instancetype)copyWithZone:(NSZone*)zone { | 91 - (instancetype)copyWithZone:(NSZone*)zone { |
| 86 XCallbackParameters* copy = [[[self class] allocWithZone:zone] init]; | 92 XCallbackParameters* copy = [[[self class] allocWithZone:zone] init]; |
| 87 copy->_sourceAppId.reset([_sourceAppId copy]); | 93 copy->_sourceAppId.reset([_sourceAppId copy]); |
| 88 copy->_sourceAppName.reset([_sourceAppName copy]); | 94 copy->_sourceAppName.reset([_sourceAppName copy]); |
| 89 copy->_successURL = _successURL; | 95 copy->_successURL = _successURL; |
| 90 copy->_createNewTab = _createNewTab; | 96 copy->_createNewTab = _createNewTab; |
| 91 return copy; | 97 return copy; |
| 92 } | 98 } |
| 93 | 99 |
| 94 @end | 100 @end |
| OLD | NEW |