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/toolbar/web_toolbar_controller.h" | 5 #import "ios/chrome/browser/ui/toolbar/web_toolbar_controller.h" |
6 | 6 |
7 #import <CoreLocation/CoreLocation.h> | 7 #import <CoreLocation/CoreLocation.h> |
8 #include <QuartzCore/QuartzCore.h> | 8 #include <QuartzCore/QuartzCore.h> |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 | 1242 |
1243 #pragma mark - | 1243 #pragma mark - |
1244 #pragma mark LocationBarDelegate methods. | 1244 #pragma mark LocationBarDelegate methods. |
1245 | 1245 |
1246 - (void)loadGURLFromLocationBar:(const GURL&)url | 1246 - (void)loadGURLFromLocationBar:(const GURL&)url |
1247 transition:(ui::PageTransition)transition { | 1247 transition:(ui::PageTransition)transition { |
1248 if (url.SchemeIs(url::kJavaScriptScheme)) { | 1248 if (url.SchemeIs(url::kJavaScriptScheme)) { |
1249 // Evaluate the URL as JavaScript if its scheme is JavaScript. | 1249 // Evaluate the URL as JavaScript if its scheme is JavaScript. |
1250 NSString* jsToEval = [base::SysUTF8ToNSString(url.GetContent()) | 1250 NSString* jsToEval = [base::SysUTF8ToNSString(url.GetContent()) |
1251 stringByRemovingPercentEncoding]; | 1251 stringByRemovingPercentEncoding]; |
1252 [self.delegate loadJavaScriptFromLocationBar:jsToEval]; | 1252 [self.urlLoader loadJavaScriptFromLocationBar:jsToEval]; |
1253 } else { | 1253 } else { |
1254 // When opening a URL, force the omnibox to resign first responder. This | 1254 // When opening a URL, force the omnibox to resign first responder. This |
1255 // will also close the popup. | 1255 // will also close the popup. |
1256 | 1256 |
1257 // TODO(rohitrao): Is it ok to call |cancelOmniboxEdit| after |loadURL|? It | 1257 // TODO(rohitrao): Is it ok to call |cancelOmniboxEdit| after |loadURL|? It |
1258 // doesn't seem to be causing major problems. If we call cancel before | 1258 // doesn't seem to be causing major problems. If we call cancel before |
1259 // load, then any prerendered pages get destroyed before the call to load. | 1259 // load, then any prerendered pages get destroyed before the call to load. |
1260 [self.urlLoader loadURL:url | 1260 [self.urlLoader loadURL:url |
1261 referrer:web::Referrer() | 1261 referrer:web::Referrer() |
1262 transition:transition | 1262 transition:transition |
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2569 | 2569 |
2570 - (BOOL)isPrerenderAnimationRunning { | 2570 - (BOOL)isPrerenderAnimationRunning { |
2571 return _prerenderAnimating; | 2571 return _prerenderAnimating; |
2572 } | 2572 } |
2573 | 2573 |
2574 - (OmniboxTextFieldIOS*)omnibox { | 2574 - (OmniboxTextFieldIOS*)omnibox { |
2575 return _omniBox.get(); | 2575 return _omniBox.get(); |
2576 } | 2576 } |
2577 | 2577 |
2578 @end | 2578 @end |
OLD | NEW |