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 #include "components/html_viewer/html_widget.h" | 5 #include "components/html_viewer/html_widget.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "cc/blink/web_layer_impl.h" | |
9 #include "cc/layers/layer_settings.h" | |
8 #include "components/html_viewer/blink_settings.h" | 10 #include "components/html_viewer/blink_settings.h" |
9 #include "components/html_viewer/global_state.h" | 11 #include "components/html_viewer/global_state.h" |
10 #include "components/html_viewer/ime_controller.h" | 12 #include "components/html_viewer/ime_controller.h" |
11 #include "components/html_viewer/stats_collection_controller.h" | 13 #include "components/html_viewer/stats_collection_controller.h" |
12 #include "components/html_viewer/web_layer_tree_view_impl.h" | 14 #include "components/html_viewer/web_layer_tree_view_impl.h" |
13 #include "components/html_viewer/web_storage_namespace_impl.h" | 15 #include "components/html_viewer/web_storage_namespace_impl.h" |
14 #include "components/mus/public/cpp/window.h" | 16 #include "components/mus/public/cpp/window.h" |
15 #include "mojo/application/public/cpp/application_impl.h" | 17 #include "mojo/application/public/cpp/application_impl.h" |
16 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" | 18 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" |
17 #include "third_party/WebKit/public/web/WebFrameWidget.h" | 19 #include "third_party/WebKit/public/web/WebFrameWidget.h" |
20 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | |
18 #include "third_party/WebKit/public/web/WebSettings.h" | 21 #include "third_party/WebKit/public/web/WebSettings.h" |
19 #include "third_party/WebKit/public/web/WebView.h" | 22 #include "third_party/WebKit/public/web/WebView.h" |
20 #include "ui/gfx/geometry/dip_util.h" | 23 #include "ui/gfx/geometry/dip_util.h" |
21 | 24 |
22 namespace html_viewer { | 25 namespace html_viewer { |
23 namespace { | 26 namespace { |
24 | 27 |
25 scoped_ptr<WebLayerTreeViewImpl> CreateWebLayerTreeView( | 28 scoped_ptr<WebLayerTreeViewImpl> CreateWebLayerTreeView( |
26 GlobalState* global_state) { | 29 GlobalState* global_state) { |
27 return make_scoped_ptr(new WebLayerTreeViewImpl( | 30 return make_scoped_ptr(new WebLayerTreeViewImpl( |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 mus::Window* window) | 87 mus::Window* window) |
85 : app(app), global_state(global_state), window(window) {} | 88 : app(app), global_state(global_state), window(window) {} |
86 | 89 |
87 HTMLWidgetRootLocal::CreateParams::~CreateParams() {} | 90 HTMLWidgetRootLocal::CreateParams::~CreateParams() {} |
88 | 91 |
89 HTMLWidgetRootLocal::HTMLWidgetRootLocal(CreateParams* create_params) | 92 HTMLWidgetRootLocal::HTMLWidgetRootLocal(CreateParams* create_params) |
90 : app_(create_params->app), | 93 : app_(create_params->app), |
91 global_state_(create_params->global_state), | 94 global_state_(create_params->global_state), |
92 window_(create_params->window), | 95 window_(create_params->window), |
93 web_view_(nullptr) { | 96 web_view_(nullptr) { |
97 // Use new animation system (cc::AnimationHost). | |
sky
2015/11/30 17:45:29
This state looks like it's global state, and not p
loyso (OOO)
2015/12/02 03:58:27
Done.
| |
98 cc::LayerSettings layer_settings; | |
99 layer_settings.use_compositor_animation_timelines = true; | |
100 cc_blink::WebLayerImpl::SetLayerSettings(layer_settings); | |
101 blink::WebRuntimeFeatures::enableCompositorAnimationTimelines(true); | |
102 | |
94 web_view_ = blink::WebView::create(this); | 103 web_view_ = blink::WebView::create(this); |
95 ime_controller_.reset(new ImeController(window_, web_view_)); | 104 ime_controller_.reset(new ImeController(window_, web_view_)); |
96 // Creating the widget calls initializeLayerTreeView() to create the | 105 // Creating the widget calls initializeLayerTreeView() to create the |
97 // |web_layer_tree_view_impl_|. As we haven't yet assigned the |web_view_| | 106 // |web_layer_tree_view_impl_|. As we haven't yet assigned the |web_view_| |
98 // we have to set it here. | 107 // we have to set it here. |
99 if (web_layer_tree_view_impl_) { | 108 if (web_layer_tree_view_impl_) { |
100 InitializeWebLayerTreeView(web_layer_tree_view_impl_.get(), app_, window_, | 109 InitializeWebLayerTreeView(web_layer_tree_view_impl_.get(), app_, window_, |
101 web_view_); | 110 web_view_); |
102 UpdateWebViewSizeFromViewSize(window_, web_view_, | 111 UpdateWebViewSizeFromViewSize(window_, web_view_, |
103 web_layer_tree_view_impl_.get()); | 112 web_layer_tree_view_impl_.get()); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
212 | 221 |
213 void HTMLWidgetLocalRoot::didUpdateTextOfFocusedElementByNonUserInput() { | 222 void HTMLWidgetLocalRoot::didUpdateTextOfFocusedElementByNonUserInput() { |
214 ime_controller_->DidUpdateTextOfFocusedElementByNonUserInput(); | 223 ime_controller_->DidUpdateTextOfFocusedElementByNonUserInput(); |
215 } | 224 } |
216 | 225 |
217 void HTMLWidgetLocalRoot::showImeIfNeeded() { | 226 void HTMLWidgetLocalRoot::showImeIfNeeded() { |
218 ime_controller_->ShowImeIfNeeded(); | 227 ime_controller_->ShowImeIfNeeded(); |
219 } | 228 } |
220 | 229 |
221 } // namespace html_viewer | 230 } // namespace html_viewer |
OLD | NEW |