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 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 params.browser_controls_shrink_blink_size; | 2236 params.browser_controls_shrink_blink_size; |
2236 top_controls_height_ = params.top_controls_height; | 2237 top_controls_height_ = params.top_controls_height; |
2237 | 2238 |
2238 RenderWidget::OnResize(params); | 2239 RenderWidget::OnResize(params); |
2239 | 2240 |
2240 if (old_visible_viewport_size != visible_viewport_size_) | 2241 if (old_visible_viewport_size != visible_viewport_size_) |
2241 has_scrolled_focused_editable_node_into_rect_ = false; | 2242 has_scrolled_focused_editable_node_into_rect_ = false; |
2242 } | 2243 } |
2243 | 2244 |
2244 void RenderViewImpl::OnSetBackgroundOpaque(bool opaque) { | 2245 void RenderViewImpl::OnSetBackgroundOpaque(bool opaque) { |
2245 if (frame_widget_) | 2246 if (!frame_widget_) |
2246 frame_widget_->setIsTransparent(!opaque); | 2247 return; |
2247 if (compositor_) | 2248 |
2248 compositor_->setHasTransparentBackground(!opaque); | 2249 if (opaque) { |
| 2250 frame_widget_->clearBaseBackgroundColorOverride(); |
| 2251 frame_widget_->clearBackgroundColorOverride(); |
| 2252 } else { |
| 2253 frame_widget_->setBaseBackgroundColorOverride(SK_ColorTRANSPARENT); |
| 2254 frame_widget_->setBackgroundColorOverride(SK_ColorTRANSPARENT); |
| 2255 } |
2249 } | 2256 } |
2250 | 2257 |
2251 void RenderViewImpl::OnSetActive(bool active) { | 2258 void RenderViewImpl::OnSetActive(bool active) { |
2252 if (webview()) | 2259 if (webview()) |
2253 webview()->setIsActive(active); | 2260 webview()->setIsActive(active); |
2254 } | 2261 } |
2255 | 2262 |
2256 blink::WebWidget* RenderViewImpl::GetWebWidget() const { | 2263 blink::WebWidget* RenderViewImpl::GetWebWidget() const { |
2257 if (frame_widget_) | 2264 if (frame_widget_) |
2258 return frame_widget_; | 2265 return frame_widget_; |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2712 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2719 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
2713 } | 2720 } |
2714 | 2721 |
2715 std::unique_ptr<InputEventAck> ack( | 2722 std::unique_ptr<InputEventAck> ack( |
2716 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), | 2723 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), |
2717 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 2724 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
2718 OnInputEventAck(std::move(ack)); | 2725 OnInputEventAck(std::move(ack)); |
2719 } | 2726 } |
2720 | 2727 |
2721 } // namespace content | 2728 } // namespace content |
OLD | NEW |