OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 157 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
158 #include "third_party/WebKit/public/web/WebScriptSource.h" | 158 #include "third_party/WebKit/public/web/WebScriptSource.h" |
159 #include "third_party/WebKit/public/web/WebSearchableFormData.h" | 159 #include "third_party/WebKit/public/web/WebSearchableFormData.h" |
160 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 160 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
161 #include "third_party/WebKit/public/web/WebSettings.h" | 161 #include "third_party/WebKit/public/web/WebSettings.h" |
162 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 162 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
163 #include "third_party/WebKit/public/web/WebView.h" | 163 #include "third_party/WebKit/public/web/WebView.h" |
164 #include "third_party/WebKit/public/web/WebWindowFeatures.h" | 164 #include "third_party/WebKit/public/web/WebWindowFeatures.h" |
165 #include "third_party/icu/source/common/unicode/uchar.h" | 165 #include "third_party/icu/source/common/unicode/uchar.h" |
166 #include "third_party/icu/source/common/unicode/uscript.h" | 166 #include "third_party/icu/source/common/unicode/uscript.h" |
| 167 #include "third_party/skia/include/core/SkColor.h" |
167 #include "ui/base/ui_base_switches_util.h" | 168 #include "ui/base/ui_base_switches_util.h" |
168 #include "ui/events/latency_info.h" | 169 #include "ui/events/latency_info.h" |
169 #include "ui/gfx/geometry/point.h" | 170 #include "ui/gfx/geometry/point.h" |
170 #include "ui/gfx/geometry/rect.h" | 171 #include "ui/gfx/geometry/rect.h" |
171 #include "ui/gfx/geometry/rect_conversions.h" | 172 #include "ui/gfx/geometry/rect_conversions.h" |
172 #include "ui/gfx/geometry/size_conversions.h" | 173 #include "ui/gfx/geometry/size_conversions.h" |
173 #include "ui/gfx/native_widget_types.h" | 174 #include "ui/gfx/native_widget_types.h" |
174 #include "url/origin.h" | 175 #include "url/origin.h" |
175 #include "url/url_constants.h" | 176 #include "url/url_constants.h" |
176 #include "v8/include/v8.h" | 177 #include "v8/include/v8.h" |
(...skipping 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2244 params.browser_controls_shrink_blink_size; | 2245 params.browser_controls_shrink_blink_size; |
2245 top_controls_height_ = params.top_controls_height; | 2246 top_controls_height_ = params.top_controls_height; |
2246 | 2247 |
2247 RenderWidget::OnResize(params); | 2248 RenderWidget::OnResize(params); |
2248 | 2249 |
2249 if (old_visible_viewport_size != visible_viewport_size_) | 2250 if (old_visible_viewport_size != visible_viewport_size_) |
2250 has_scrolled_focused_editable_node_into_rect_ = false; | 2251 has_scrolled_focused_editable_node_into_rect_ = false; |
2251 } | 2252 } |
2252 | 2253 |
2253 void RenderViewImpl::OnSetBackgroundOpaque(bool opaque) { | 2254 void RenderViewImpl::OnSetBackgroundOpaque(bool opaque) { |
2254 if (frame_widget_) | 2255 if (!frame_widget_) |
2255 frame_widget_->setIsTransparent(!opaque); | 2256 return; |
2256 if (compositor_) | 2257 |
2257 compositor_->setHasTransparentBackground(!opaque); | 2258 if (opaque) { |
| 2259 frame_widget_->clearBaseBackgroundColorOverride(); |
| 2260 frame_widget_->clearBackgroundColorOverride(); |
| 2261 } else { |
| 2262 frame_widget_->setBaseBackgroundColorOverride(SK_ColorTRANSPARENT); |
| 2263 frame_widget_->setBackgroundColorOverride(SK_ColorTRANSPARENT); |
| 2264 } |
2258 } | 2265 } |
2259 | 2266 |
2260 void RenderViewImpl::OnSetActive(bool active) { | 2267 void RenderViewImpl::OnSetActive(bool active) { |
2261 if (webview()) | 2268 if (webview()) |
2262 webview()->setIsActive(active); | 2269 webview()->setIsActive(active); |
2263 } | 2270 } |
2264 | 2271 |
2265 blink::WebWidget* RenderViewImpl::GetWebWidget() const { | 2272 blink::WebWidget* RenderViewImpl::GetWebWidget() const { |
2266 if (frame_widget_) | 2273 if (frame_widget_) |
2267 return frame_widget_; | 2274 return frame_widget_; |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2721 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2728 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
2722 } | 2729 } |
2723 | 2730 |
2724 std::unique_ptr<InputEventAck> ack( | 2731 std::unique_ptr<InputEventAck> ack( |
2725 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), | 2732 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), |
2726 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 2733 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
2727 OnInputEventAck(std::move(ack)); | 2734 OnInputEventAck(std::move(ack)); |
2728 } | 2735 } |
2729 | 2736 |
2730 } // namespace content | 2737 } // namespace content |
OLD | NEW |