roll libyuv from 1483 to 1487
[chromium-blink-merge.git] / ios / chrome / browser / app_startup_parameters.mm
blob1a499360d4fc804d9b9999dd89f278b1a4836d03
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.
5 #import "ios/chrome/browser/app_startup_parameters.h"
7 #include "base/logging.h"
8 #import "base/mac/scoped_nsobject.h"
9 #import "ios/chrome/browser/xcallback_parameters.h"
10 #include "url/gurl.h"
12 @implementation AppStartupParameters {
13   GURL _externalURL;
14   base::scoped_nsobject<XCallbackParameters> _xCallbackParameters;
15   BOOL _launchVoiceSearch;
18 @synthesize launchVoiceSearch = _launchVoiceSearch;
20 - (const GURL&)externalURL {
21   return _externalURL;
24 - (XCallbackParameters*)xCallbackParameters {
25   return _xCallbackParameters.get();
28 - (instancetype)init {
29   NOTREACHED();
30   return
31       [self initWithExternalURL:GURL() xCallbackParameters:nil voiceSearch:NO];
34 - (instancetype)initWithExternalURL:(const GURL&)externalURL {
35   return [self initWithExternalURL:externalURL
36                xCallbackParameters:nil
37                        voiceSearch:NO];
40 - (instancetype)initWithExternalURL:(const GURL&)externalURL
41                 xCallbackParameters:(XCallbackParameters*)xCallbackParameters {
42   return [self initWithExternalURL:externalURL
43                xCallbackParameters:xCallbackParameters
44                        voiceSearch:NO];
47 - (instancetype)initWithExternalURL:(const GURL&)externalURL
48                 xCallbackParameters:(XCallbackParameters*)xCallbackParameters
49                         voiceSearch:(BOOL)voicesearch {
50   self = [super init];
51   if (self) {
52     _externalURL = GURL(externalURL);
53     _xCallbackParameters.reset([xCallbackParameters retain]);
54     _launchVoiceSearch = voicesearch;
55   }
56   return self;
59 - (NSString*)description {
60   return [NSString stringWithFormat:@"ExternalURL: %s \nXCallbackParams: %@",
61                                     _externalURL.spec().c_str(),
62                                     _xCallbackParameters.get()];
65 @end