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 #include "base/mac/scoped_nsobject.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 self.autoresizingMask = | 75 self.autoresizingMask = |
76 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; | 76 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; |
77 [self addSubview:_webView]; | 77 [self addSubview:_webView]; |
78 self.backgroundColor = [UIColor colorWithRed:kBackgroundRGBComponents[0] | 78 self.backgroundColor = [UIColor colorWithRed:kBackgroundRGBComponents[0] |
79 green:kBackgroundRGBComponents[1] | 79 green:kBackgroundRGBComponents[1] |
80 blue:kBackgroundRGBComponents[2] | 80 blue:kBackgroundRGBComponents[2] |
81 alpha:1.0]; | 81 alpha:1.0]; |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
| 85 - (BOOL)becomeFirstResponder { |
| 86 return [_webView becomeFirstResponder]; |
| 87 } |
| 88 |
85 #pragma mark Accessors | 89 #pragma mark Accessors |
86 | 90 |
87 - (UIScrollView*)scrollView { | 91 - (UIScrollView*)scrollView { |
88 return _scrollView.get(); | 92 return _scrollView.get(); |
89 } | 93 } |
90 | 94 |
91 - (UIView*)webView { | 95 - (UIView*)webView { |
92 return _webView.get(); | 96 return _webView.get(); |
93 } | 97 } |
94 | 98 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 131 |
128 - (void)updateWebViewFrame { | 132 - (void)updateWebViewFrame { |
129 CGRect webViewFrame = self.bounds; | 133 CGRect webViewFrame = self.bounds; |
130 webViewFrame.size.height -= _topContentPadding; | 134 webViewFrame.size.height -= _topContentPadding; |
131 webViewFrame.origin.y += _topContentPadding; | 135 webViewFrame.origin.y += _topContentPadding; |
132 | 136 |
133 self.webView.frame = webViewFrame; | 137 self.webView.frame = webViewFrame; |
134 } | 138 } |
135 | 139 |
136 @end | 140 @end |
OLD | NEW |