Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: ios/chrome/app/application_delegate/mock_tab_opener.mm

Issue 2706033003: [ObjC ARC] Converts ios/chrome/app/application_delegate:test_support to ARC. (Closed)
Patch Set: comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/chrome/app/application_delegate/mock_tab_opener.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #include "ios/chrome/app/application_delegate/mock_tab_opener.h" 5 #include "ios/chrome/app/application_delegate/mock_tab_opener.h"
6 6
7 #include "base/ios/block_types.h" 7 #include "base/ios/block_types.h"
8 #include "base/mac/scoped_block.h" 8 #include "base/mac/scoped_block.h"
9 #include "ios/chrome/app/application_mode.h" 9 #include "ios/chrome/app/application_mode.h"
10 #include "ui/base/page_transition_types.h" 10 #include "ui/base/page_transition_types.h"
11 #include "url/gurl.h" 11 #include "url/gurl.h"
12 12
13 @interface MockTabOpener () { 13 #if !defined(__has_feature) || !__has_feature(objc_arc)
14 base::mac::ScopedBlock<ProceduralBlock> _completionBlock; 14 #error "This file requires ARC support."
15 } 15 #endif
16
17 @end
18 16
19 @implementation MockTabOpener 17 @implementation MockTabOpener
20 18
21 @synthesize url = _url; 19 @synthesize url = _url;
22 @synthesize applicationMode = _applicationMode; 20 @synthesize applicationMode = _applicationMode;
21 @synthesize completionBlock = _completionBlock;
23 22
24 - (void)dismissModalsAndOpenSelectedTabInMode:(ApplicationMode)targetMode 23 - (void)dismissModalsAndOpenSelectedTabInMode:(ApplicationMode)targetMode
25 withURL:(const GURL&)url 24 withURL:(const GURL&)url
26 transition:(ui::PageTransition)transition 25 transition:(ui::PageTransition)transition
27 completion:(ProceduralBlock)handler { 26 completion:(ProceduralBlock)handler {
28 _url = url; 27 _url = url;
29 _applicationMode = targetMode; 28 _applicationMode = targetMode;
30 _completionBlock.reset([handler copy]); 29 _completionBlock = [handler copy];
31 } 30 }
32 31
33 - (void)resetURL { 32 - (void)resetURL {
34 _url = _url.EmptyGURL(); 33 _url = _url.EmptyGURL();
35 } 34 }
36 35
37 - (void (^)())completionBlock {
38 return _completionBlock;
39 }
40
41 - (void)openTabFromLaunchOptions:(NSDictionary*)launchOptions 36 - (void)openTabFromLaunchOptions:(NSDictionary*)launchOptions
42 startupInformation:(id<StartupInformation>)startupInformation 37 startupInformation:(id<StartupInformation>)startupInformation
43 appState:(AppState*)appState { 38 appState:(AppState*)appState {
44 // Stub. 39 // Stub.
45 } 40 }
46 41
47 - (BOOL)shouldOpenNTPTabOnActivationOfTabModel:(TabModel*)tabModel { 42 - (BOOL)shouldOpenNTPTabOnActivationOfTabModel:(TabModel*)tabModel {
48 // Stub. 43 // Stub.
49 return YES; 44 return YES;
50 } 45 }
51 46
52 @end 47 @end
OLDNEW
« no previous file with comments | « ios/chrome/app/application_delegate/mock_tab_opener.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698