| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/public/web_state/ui/crw_web_view_content_view.h" | 5 #import "ios/web/public/web_state/ui/crw_web_view_content_view.h" |
| 6 | 6 |
| 7 #import <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 // Background color RGB values for the content view which is displayed when the | 14 // Background color RGB values for the content view which is displayed when the |
| 15 // |_webView| is offset from the screen due to user interaction. Displaying this | 15 // |_webView| is offset from the screen due to user interaction. Displaying this |
| 16 // background color is handled by UIWebView but not WKWebView, so it needs to be | 16 // background color is handled by UIWebView but not WKWebView, so it needs to be |
| 17 // set in CRWWebViewContentView to support both. The color value matches that | 17 // set in CRWWebViewContentView to support both. The color value matches that |
| 18 // used by UIWebView. | 18 // used by UIWebView. |
| 19 const CGFloat kBackgroundRGBComponents[] = {0.75f, 0.74f, 0.76f}; | 19 const CGFloat kBackgroundRGBComponents[] = {0.75f, 0.74f, 0.76f}; |
| 20 | 20 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 - (void)updateWebViewFrame { | 166 - (void)updateWebViewFrame { |
| 167 CGRect webViewFrame = self.bounds; | 167 CGRect webViewFrame = self.bounds; |
| 168 webViewFrame.size.height -= _topContentPadding; | 168 webViewFrame.size.height -= _topContentPadding; |
| 169 webViewFrame.origin.y += _topContentPadding; | 169 webViewFrame.origin.y += _topContentPadding; |
| 170 | 170 |
| 171 self.webView.frame = webViewFrame; | 171 self.webView.frame = webViewFrame; |
| 172 } | 172 } |
| 173 | 173 |
| 174 @end | 174 @end |
| OLD | NEW |