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

Unified Diff: ios/web_view/shell/translate_controller.mm

Issue 2659393004: Convert ios_web_view_shell to pure Objective-C. (Closed)
Patch Set: Move const and format. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web_view/shell/translate_controller.m ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web_view/shell/translate_controller.mm
diff --git a/ios/web_view/shell/translate_controller.mm b/ios/web_view/shell/translate_controller.mm
deleted file mode 100644
index 98bc51bce606b0d846414ace6b139504f2d090ca..0000000000000000000000000000000000000000
--- a/ios/web_view/shell/translate_controller.mm
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "ios/web_view/shell/translate_controller.h"
-
-#import <UIKit/UIKit.h>
-
-#include "base/logging.h"
-#import "ios/web_view/public/criwv_translate_manager.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-@interface TranslateController ()
-// Action Sheet to prompt user whether or not the page should be translated.
-@property (nonatomic, strong) UIAlertController* beforeTranslateActionSheet;
-// Manager which performs the translation of the content.
-@property (nonatomic, strong) id<CRIWVTranslateManager> translateManager;
-@end
-
-@implementation TranslateController
-
-@synthesize beforeTranslateActionSheet = _beforeTranslateActionSheet;
-@synthesize translateManager = _translateManager;
-
-- (void)dealloc {
- [_beforeTranslateActionSheet dismissViewControllerAnimated:YES
- completion:nil];
-}
-
-#pragma mark CRIWVTranslateDelegate methods
-
-- (void)translateStepChanged:(CRIWVTransateStep)step
- manager:(id<CRIWVTranslateManager>)manager {
- if (step == CRIWVTransateStepBeforeTranslate) {
- DCHECK(!_translateManager);
- DCHECK(!_beforeTranslateActionSheet);
- self.translateManager = manager;
- self.beforeTranslateActionSheet = [UIAlertController
- alertControllerWithTitle:nil
- message:@"Translate?"
- preferredStyle:UIAlertControllerStyleActionSheet];
- UIAlertAction* cancelAction =
- [UIAlertAction actionWithTitle:@"Nope."
- style:UIAlertActionStyleCancel
- handler:^(UIAlertAction* action) {
- DCHECK(_beforeTranslateActionSheet);
- self.beforeTranslateActionSheet = nil;
- DCHECK(_translateManager);
- self.translateManager = nil;
- }];
- [_beforeTranslateActionSheet addAction:cancelAction];
-
- UIAlertAction* translateAction =
- [UIAlertAction actionWithTitle:@"Yes!"
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction* action) {
- DCHECK(_beforeTranslateActionSheet);
- self.beforeTranslateActionSheet = nil;
- DCHECK(_translateManager);
- [_translateManager translate];
- self.translateManager = nil;
- }];
- [_beforeTranslateActionSheet addAction:translateAction];
-
- [[UIApplication sharedApplication].keyWindow.rootViewController
- presentViewController:_beforeTranslateActionSheet
- animated:YES
- completion:nil];
- }
-}
-
-@end
« no previous file with comments | « ios/web_view/shell/translate_controller.m ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698