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

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

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/shell_view_controller.mm ('k') | ios/web_view/shell/translate_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web_view/shell/translate_controller.m
diff --git a/ios/web_view/shell/translate_controller.mm b/ios/web_view/shell/translate_controller.m
similarity index 83%
rename from ios/web_view/shell/translate_controller.mm
rename to ios/web_view/shell/translate_controller.m
index 98bc51bce606b0d846414ace6b139504f2d090ca..f271f5f4ae2c31217d88fef625192fd95f79fa3b 100644
--- a/ios/web_view/shell/translate_controller.mm
+++ b/ios/web_view/shell/translate_controller.m
@@ -6,7 +6,6 @@
#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)
@@ -15,9 +14,9 @@
@interface TranslateController ()
// Action Sheet to prompt user whether or not the page should be translated.
-@property (nonatomic, strong) UIAlertController* beforeTranslateActionSheet;
+@property(nonatomic, strong) UIAlertController* beforeTranslateActionSheet;
// Manager which performs the translation of the content.
-@property (nonatomic, strong) id<CRIWVTranslateManager> translateManager;
+@property(nonatomic, strong) id<CRIWVTranslateManager> translateManager;
@end
@implementation TranslateController
@@ -35,8 +34,6 @@
- (void)translateStepChanged:(CRIWVTransateStep)step
manager:(id<CRIWVTranslateManager>)manager {
if (step == CRIWVTransateStepBeforeTranslate) {
- DCHECK(!_translateManager);
- DCHECK(!_beforeTranslateActionSheet);
self.translateManager = manager;
self.beforeTranslateActionSheet = [UIAlertController
alertControllerWithTitle:nil
@@ -46,9 +43,7 @@
[UIAlertAction actionWithTitle:@"Nope."
style:UIAlertActionStyleCancel
handler:^(UIAlertAction* action) {
- DCHECK(_beforeTranslateActionSheet);
self.beforeTranslateActionSheet = nil;
- DCHECK(_translateManager);
self.translateManager = nil;
}];
[_beforeTranslateActionSheet addAction:cancelAction];
@@ -57,9 +52,7 @@
[UIAlertAction actionWithTitle:@"Yes!"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction* action) {
- DCHECK(_beforeTranslateActionSheet);
self.beforeTranslateActionSheet = nil;
- DCHECK(_translateManager);
[_translateManager translate];
self.translateManager = nil;
}];
« no previous file with comments | « ios/web_view/shell/shell_view_controller.mm ('k') | ios/web_view/shell/translate_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698