| 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/browser/web_contents/web_contents_view_android.h" | 5 #include "content/browser/web_contents/web_contents_view_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 *render_view_host_delegate_view = rv; | 75 *render_view_host_delegate_view = rv; |
| 76 return rv; | 76 return rv; |
| 77 } | 77 } |
| 78 | 78 |
| 79 WebContentsViewAndroid::WebContentsViewAndroid( | 79 WebContentsViewAndroid::WebContentsViewAndroid( |
| 80 WebContentsImpl* web_contents, | 80 WebContentsImpl* web_contents, |
| 81 WebContentsViewDelegate* delegate) | 81 WebContentsViewDelegate* delegate) |
| 82 : web_contents_(web_contents), | 82 : web_contents_(web_contents), |
| 83 content_view_core_(NULL), | 83 content_view_core_(NULL), |
| 84 delegate_(delegate), | 84 delegate_(delegate), |
| 85 view_(this), |
| 85 synchronous_compositor_client_(nullptr) { | 86 synchronous_compositor_client_(nullptr) { |
| 86 } | 87 } |
| 87 | 88 |
| 88 WebContentsViewAndroid::~WebContentsViewAndroid() { | 89 WebContentsViewAndroid::~WebContentsViewAndroid() { |
| 89 if (view_.GetLayer()) | 90 if (view_.GetLayer()) |
| 90 view_.GetLayer()->RemoveFromParent(); | 91 view_.GetLayer()->RemoveFromParent(); |
| 91 } | 92 } |
| 92 | 93 |
| 93 void WebContentsViewAndroid::SetContentViewCore( | 94 void WebContentsViewAndroid::SetContentViewCore( |
| 94 ContentViewCoreImpl* content_view_core) { | 95 ContentViewCoreImpl* content_view_core) { |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 // This is called when we the renderer asks us to take focus back (i.e., it has | 389 // This is called when we the renderer asks us to take focus back (i.e., it has |
| 389 // iterated past the last focusable element on the page). | 390 // iterated past the last focusable element on the page). |
| 390 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 391 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
| 391 if (web_contents_->GetDelegate() && | 392 if (web_contents_->GetDelegate() && |
| 392 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 393 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
| 393 return; | 394 return; |
| 394 web_contents_->GetRenderWidgetHostView()->Focus(); | 395 web_contents_->GetRenderWidgetHostView()->Focus(); |
| 395 } | 396 } |
| 396 | 397 |
| 397 } // namespace content | 398 } // namespace content |
| OLD | NEW |