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/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid( | 47 RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid( |
48 RenderWidgetHostImpl* widget_host, | 48 RenderWidgetHostImpl* widget_host, |
49 ContentViewCoreImpl* content_view_core) | 49 ContentViewCoreImpl* content_view_core) |
50 : host_(widget_host), | 50 : host_(widget_host), |
51 // ContentViewCoreImpl represents the native side of the Java | 51 // ContentViewCoreImpl represents the native side of the Java |
52 // ContentViewCore. It being NULL means that it is not attached to the | 52 // ContentViewCore. It being NULL means that it is not attached to the |
53 // View system yet, so we treat it as hidden. | 53 // View system yet, so we treat it as hidden. |
54 is_hidden_(!content_view_core), | 54 is_hidden_(!content_view_core), |
55 content_view_core_(content_view_core), | 55 content_view_core_(content_view_core), |
56 ime_adapter_android_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 56 ime_adapter_android_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
57 texture_layer_(WebKit::WebExternalTextureLayer::create()), | 57 texture_layer_(WebKit::Platform::current()-> |
| 58 compositorSupport()->createExternalTextureLayer()), |
58 texture_id_in_layer_(0) { | 59 texture_id_in_layer_(0) { |
59 host_->SetView(this); | 60 host_->SetView(this); |
60 // RenderWidgetHost is initialized as visible. If is_hidden_ is true, tell | 61 // RenderWidgetHost is initialized as visible. If is_hidden_ is true, tell |
61 // RenderWidgetHost to hide. | 62 // RenderWidgetHost to hide. |
62 if (is_hidden_) | 63 if (is_hidden_) |
63 host_->WasHidden(); | 64 host_->WasHidden(); |
64 texture_layer_->layer()->setOpaque(true); | 65 texture_layer_->layer()->setOpaque(true); |
65 texture_layer_->layer()->setDrawsContent(!is_hidden_); | 66 texture_layer_->layer()->setDrawsContent(!is_hidden_); |
66 host_->AttachLayer(texture_layer_->layer()); | 67 host_->AttachLayer(texture_layer_->layer()); |
67 } | 68 } |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 // RenderWidgetHostView, public: | 576 // RenderWidgetHostView, public: |
576 | 577 |
577 // static | 578 // static |
578 RenderWidgetHostView* | 579 RenderWidgetHostView* |
579 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 580 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
580 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 581 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
581 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 582 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
582 } | 583 } |
583 | 584 |
584 } // namespace content | 585 } // namespace content |
OLD | NEW |