| Index: sky/viewer/document_view.cc
|
| diff --git a/sky/viewer/document_view.cc b/sky/viewer/document_view.cc
|
| index 1d9bdea793bd2585e4d86acfabacb75e44c8212f..7b4922678f3ae09d813c934c734ff4eb066bffd7 100644
|
| --- a/sky/viewer/document_view.cc
|
| +++ b/sky/viewer/document_view.cc
|
| @@ -114,6 +114,9 @@ void DocumentView::OnEmbed(
|
|
|
| gfx::Size size = root_->bounds().To<gfx::Rect>().size();
|
| web_view_->resize(size);
|
| + // TODO(abarth): We should ask the view whether it is focused instead of
|
| + // assuming that we're focused.
|
| + web_view_->setFocus(true);
|
| web_layer_tree_view_impl_->setViewportSize(size);
|
| web_layer_tree_view_impl_->set_view(root_);
|
| root_->AddObserver(this);
|
| @@ -215,6 +218,15 @@ void DocumentView::OnViewBoundsChanged(mojo::View* view,
|
| web_layer_tree_view_impl_->setViewportSize(size);
|
| }
|
|
|
| +void DocumentView::OnViewFocusChanged(mojo::View* gained_focus,
|
| + mojo::View* lost_focus) {
|
| + if (root_ == lost_focus) {
|
| + web_view_->setFocus(false);
|
| + } else if (root_ == gained_focus) {
|
| + web_view_->setFocus(true);
|
| + }
|
| +}
|
| +
|
| void DocumentView::OnViewDestroyed(mojo::View* view) {
|
| DCHECK_EQ(view, root_);
|
|
|
|
|