OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/web_view/shell/translate_controller.h" | 5 #import "ios/web_view/shell/translate_controller.h" |
6 | 6 |
7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
8 | 8 |
9 #import "ios/web_view/public/criwv_translate_manager.h" | 9 #import "ios/web_view/public/criwv_translate_manager.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 @implementation TranslateController | 22 @implementation TranslateController |
23 | 23 |
24 @synthesize beforeTranslateActionSheet = _beforeTranslateActionSheet; | 24 @synthesize beforeTranslateActionSheet = _beforeTranslateActionSheet; |
25 @synthesize translateManager = _translateManager; | 25 @synthesize translateManager = _translateManager; |
26 | 26 |
27 - (void)dealloc { | 27 - (void)dealloc { |
28 [_beforeTranslateActionSheet dismissViewControllerAnimated:YES | 28 [_beforeTranslateActionSheet dismissViewControllerAnimated:YES |
29 completion:nil]; | 29 completion:nil]; |
30 } | 30 } |
31 | 31 |
32 #pragma mark CRIWVTranslateDelegate methods | 32 #pragma mark CWVTranslateDelegate methods |
33 | 33 |
34 - (void)translateStepChanged:(CRIWVTransateStep)step | 34 - (void)translateStepChanged:(CRIWVTransateStep)step |
35 manager:(id<CRIWVTranslateManager>)manager { | 35 manager:(id<CRIWVTranslateManager>)manager { |
36 if (step == CRIWVTransateStepBeforeTranslate) { | 36 if (step == CRIWVTransateStepBeforeTranslate) { |
37 self.translateManager = manager; | 37 self.translateManager = manager; |
38 self.beforeTranslateActionSheet = [UIAlertController | 38 self.beforeTranslateActionSheet = [UIAlertController |
39 alertControllerWithTitle:nil | 39 alertControllerWithTitle:nil |
40 message:@"Translate?" | 40 message:@"Translate?" |
41 preferredStyle:UIAlertControllerStyleActionSheet]; | 41 preferredStyle:UIAlertControllerStyleActionSheet]; |
42 UIAlertAction* cancelAction = | 42 UIAlertAction* cancelAction = |
(...skipping 16 matching lines...) Expand all Loading... |
59 [_beforeTranslateActionSheet addAction:translateAction]; | 59 [_beforeTranslateActionSheet addAction:translateAction]; |
60 | 60 |
61 [[UIApplication sharedApplication].keyWindow.rootViewController | 61 [[UIApplication sharedApplication].keyWindow.rootViewController |
62 presentViewController:_beforeTranslateActionSheet | 62 presentViewController:_beforeTranslateActionSheet |
63 animated:YES | 63 animated:YES |
64 completion:nil]; | 64 completion:nil]; |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 @end | 68 @end |
OLD | NEW |