Chromium Code Reviews| 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/web_state/ui/crw_ui_web_view_web_controller.h" | 5 #import "ios/web/web_state/ui/crw_ui_web_view_web_controller.h" |
| 6 | 6 |
| 7 #import "base/ios/ns_error_util.h" | 7 #import "base/ios/ns_error_util.h" |
| 8 #import "base/ios/weak_nsobject.h" | 8 #import "base/ios/weak_nsobject.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/string_escape.h" | 10 #include "base/json/string_escape.h" |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 814 - (void)webPageChanged { | 814 - (void)webPageChanged { |
| 815 if (self.loadPhase != web::LOAD_REQUESTED || | 815 if (self.loadPhase != web::LOAD_REQUESTED || |
| 816 self.lastRegisteredRequestURL.is_empty() || | 816 self.lastRegisteredRequestURL.is_empty() || |
| 817 self.lastRegisteredRequestURL != [self currentURL]) { | 817 self.lastRegisteredRequestURL != [self currentURL]) { |
| 818 // The page change was unexpected (not already messaged to | 818 // The page change was unexpected (not already messaged to |
| 819 // webWillStartLoadingURL), so fill in the load request. | 819 // webWillStartLoadingURL), so fill in the load request. |
| 820 [self generateMissingLoadRequestWithURL:[self currentURL] | 820 [self generateMissingLoadRequestWithURL:[self currentURL] |
| 821 referrer:[self currentReferrer]]; | 821 referrer:[self currentReferrer]]; |
| 822 } | 822 } |
| 823 | 823 |
| 824 // Fetch the favicons for the new page. | |
| 825 // TODO(kkhorimoto): Consolidate favicon fetching into a single location. | |
| 826 // http://crbug.com/534573 | |
| 827 NSString *const kGetFaviconsScript = | |
| 828 @"__gCrWeb.message.invokeOnHost(" | |
|
Eugene But (OOO till 7-30)
2015/09/21 21:32:43
This approach is very fragile and will break if f.
kkhorimoto
2016/01/30 00:47:01
Done.
| |
| 829 " {'command' : 'document.favicons'," | |
| 830 " 'favicons': __gCrWeb.common.getFavicons()});"; | |
| 831 web::EvaluateJavaScript(_uiWebView, kGetFaviconsScript, nil); | |
| 832 | |
| 824 [super webPageChanged]; | 833 [super webPageChanged]; |
| 825 } | 834 } |
| 826 | 835 |
| 827 - (void)applyWebViewScrollZoomScaleFromZoomState: | 836 - (void)applyWebViewScrollZoomScaleFromZoomState: |
| 828 (const web::PageZoomState&)zoomState { | 837 (const web::PageZoomState&)zoomState { |
| 829 // A UIWebView's scroll view uses zoom scales in a non-standard way. The | 838 // A UIWebView's scroll view uses zoom scales in a non-standard way. The |
| 830 // scroll view's |zoomScale| property is always equal to 1.0, and the | 839 // scroll view's |zoomScale| property is always equal to 1.0, and the |
| 831 // |minimumZoomScale| and |maximumZoomScale| properties are adjusted | 840 // |minimumZoomScale| and |maximumZoomScale| properties are adjusted |
| 832 // proportionally to reflect the relative zoom scale. Setting the |zoomScale| | 841 // proportionally to reflect the relative zoom scale. Setting the |zoomScale| |
| 833 // property here scales the page by the value set (i.e. setting zoomScale to | 842 // property here scales the page by the value set (i.e. setting zoomScale to |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1554 } | 1563 } |
| 1555 | 1564 |
| 1556 #pragma mark - | 1565 #pragma mark - |
| 1557 #pragma mark Testing methods | 1566 #pragma mark Testing methods |
| 1558 | 1567 |
| 1559 -(id<CRWRecurringTaskDelegate>)recurringTaskDelegate { | 1568 -(id<CRWRecurringTaskDelegate>)recurringTaskDelegate { |
| 1560 return _recurringTaskDelegate; | 1569 return _recurringTaskDelegate; |
| 1561 } | 1570 } |
| 1562 | 1571 |
| 1563 @end | 1572 @end |
| OLD | NEW |