Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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/chrome/browser/ui/browser_view_controller.h" | 5 #import "ios/chrome/browser/ui/browser_view_controller.h" |
| 6 | 6 |
| 7 #import <AssetsLibrary/AssetsLibrary.h> | 7 #import <AssetsLibrary/AssetsLibrary.h> |
| 8 #import <MobileCoreServices/MobileCoreServices.h> | 8 #import <MobileCoreServices/MobileCoreServices.h> |
| 9 #import <PassKit/PassKit.h> | 9 #import <PassKit/PassKit.h> |
| 10 #import <Photos/Photos.h> | 10 #import <Photos/Photos.h> |
| (...skipping 3769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3780 inBackground:inBackground | 3780 inBackground:inBackground |
| 3781 appendTo:kLastTab]); | 3781 appendTo:kLastTab]); |
| 3782 [self chromeExecuteCommand:command]; | 3782 [self chromeExecuteCommand:command]; |
| 3783 } | 3783 } |
| 3784 | 3784 |
| 3785 - (void)loadSessionTab:(const sessions::SessionTab*)sessionTab { | 3785 - (void)loadSessionTab:(const sessions::SessionTab*)sessionTab { |
| 3786 [[_model currentTab] loadSessionTab:sessionTab]; | 3786 [[_model currentTab] loadSessionTab:sessionTab]; |
| 3787 } | 3787 } |
| 3788 | 3788 |
| 3789 - (void)openJavascript:(NSString*)javascript { | 3789 - (void)openJavascript:(NSString*)javascript { |
| 3790 [[_model currentTab] openJavascript:javascript]; | 3790 DCHECK(javascript); |
| 3791 javascript = [javascript stringByRemovingPercentEncoding]; | |
|
rohitrao (ping after 24h)
2017/01/19 21:59:09
Is this sanitization important?
Eugene But (OOO till 7-30)
2017/01/19 22:20:33
I don't know.
| |
| 3792 web::WebState* web_state = [[_model currentTab] webState]; | |
|
Eugene But (OOO till 7-30)
2017/01/19 22:20:34
s/web_state/webState
rohitrao (ping after 24h)
2017/01/20 16:12:17
Done.
| |
| 3793 if (web_state) { | |
| 3794 web_state->ExecuteJavaScript(base::SysNSStringToUTF16(javascript)); | |
|
rohitrao (ping after 24h)
2017/01/19 21:59:09
This is a little dumb because we go from UTF8 -> N
Eugene But (OOO till 7-30)
2017/01/19 22:20:33
This is user supplied JS. I don't think they can t
rohitrao (ping after 24h)
2017/01/20 16:12:17
This is not actually true. The JS supplied here c
Eugene But (OOO till 7-30)
2017/01/20 18:05:18
So maybe we should change WebState::ExecuteJavaScr
| |
| 3795 } | |
| 3791 } | 3796 } |
| 3792 | 3797 |
| 3793 #pragma mark - WebToolbarDelegate methods | 3798 #pragma mark - WebToolbarDelegate methods |
| 3794 | 3799 |
| 3795 - (IBAction)locationBarDidBecomeFirstResponder:(id)sender { | 3800 - (IBAction)locationBarDidBecomeFirstResponder:(id)sender { |
| 3796 if (_locationBarHasFocus) | 3801 if (_locationBarHasFocus) |
| 3797 return; // TODO(crbug.com/244366): This should not be necessary. | 3802 return; // TODO(crbug.com/244366): This should not be necessary. |
| 3798 _locationBarHasFocus = YES; | 3803 _locationBarHasFocus = YES; |
| 3799 [[NSNotificationCenter defaultCenter] | 3804 [[NSNotificationCenter defaultCenter] |
| 3800 postNotificationName:ios_internal:: | 3805 postNotificationName:ios_internal:: |
| (...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5134 | 5139 |
| 5135 - (UIView*)voiceSearchButton { | 5140 - (UIView*)voiceSearchButton { |
| 5136 return _voiceSearchButton; | 5141 return _voiceSearchButton; |
| 5137 } | 5142 } |
| 5138 | 5143 |
| 5139 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5144 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
| 5140 return [self currentLogoAnimationControllerOwner]; | 5145 return [self currentLogoAnimationControllerOwner]; |
| 5141 } | 5146 } |
| 5142 | 5147 |
| 5143 @end | 5148 @end |
| OLD | NEW |