| 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/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 bool RenderWidgetHostViewAndroid::OnMessageReceived( | 127 bool RenderWidgetHostViewAndroid::OnMessageReceived( |
| 128 const IPC::Message& message) { | 128 const IPC::Message& message) { |
| 129 bool handled = true; | 129 bool handled = true; |
| 130 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) | 130 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) |
| 131 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeBatchStateChanged_ACK, | 131 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeBatchStateChanged_ACK, |
| 132 OnProcessImeBatchStateAck) | 132 OnProcessImeBatchStateAck) |
| 133 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) | 133 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) |
| 134 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, | 134 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, |
| 135 OnDidChangeBodyBackgroundColor) | 135 OnDidChangeBodyBackgroundColor) |
| 136 IPC_MESSAGE_HANDLER(ViewHostMsg_SetVSyncNotificationEnabled, | 136 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginChildFrame, |
| 137 OnSetVSyncNotificationEnabled) | 137 OnSetNeedsBeginChildFrame) |
| 138 IPC_MESSAGE_UNHANDLED(handled = false) | 138 IPC_MESSAGE_UNHANDLED(handled = false) |
| 139 IPC_END_MESSAGE_MAP() | 139 IPC_END_MESSAGE_MAP() |
| 140 return handled; | 140 return handled; |
| 141 } | 141 } |
| 142 | 142 |
| 143 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { | 143 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { |
| 144 NOTIMPLEMENTED(); | 144 NOTIMPLEMENTED(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void RenderWidgetHostViewAndroid::InitAsPopup( | 147 void RenderWidgetHostViewAndroid::InitAsPopup( |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 void RenderWidgetHostViewAndroid::OnDidChangeBodyBackgroundColor( | 397 void RenderWidgetHostViewAndroid::OnDidChangeBodyBackgroundColor( |
| 398 SkColor color) { | 398 SkColor color) { |
| 399 if (cached_background_color_ == color) | 399 if (cached_background_color_ == color) |
| 400 return; | 400 return; |
| 401 | 401 |
| 402 cached_background_color_ = color; | 402 cached_background_color_ = color; |
| 403 if (content_view_core_) | 403 if (content_view_core_) |
| 404 content_view_core_->OnBackgroundColorChanged(color); | 404 content_view_core_->OnBackgroundColorChanged(color); |
| 405 } | 405 } |
| 406 | 406 |
| 407 void RenderWidgetHostViewAndroid::SendVSync(base::TimeTicks frame_time) { | 407 void RenderWidgetHostViewAndroid::SendBeginChildFrame( |
| 408 host_->Send(new ViewMsg_DidVSync(host_->GetRoutingID(), frame_time)); | 408 base::TimeTicks frame_time) { |
| 409 host_->Send(new ViewMsg_BeginChildFrame(host_->GetRoutingID(), frame_time)); |
| 409 } | 410 } |
| 410 | 411 |
| 411 void RenderWidgetHostViewAndroid::OnSetVSyncNotificationEnabled(bool enabled) { | 412 void RenderWidgetHostViewAndroid::OnSetNeedsBeginChildFrame(bool enabled) { |
| 412 if (content_view_core_) | 413 if (content_view_core_) |
| 413 content_view_core_->SetVSyncNotificationEnabled(enabled); | 414 content_view_core_->SetVSyncNotificationEnabled(enabled); |
| 414 } | 415 } |
| 415 | 416 |
| 416 void RenderWidgetHostViewAndroid::OnStartContentIntent( | 417 void RenderWidgetHostViewAndroid::OnStartContentIntent( |
| 417 const GURL& content_url) { | 418 const GURL& content_url) { |
| 418 if (content_view_core_) | 419 if (content_view_core_) |
| 419 content_view_core_->StartContentIntent(content_url); | 420 content_view_core_->StartContentIntent(content_url); |
| 420 } | 421 } |
| 421 | 422 |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 // RenderWidgetHostView, public: | 940 // RenderWidgetHostView, public: |
| 940 | 941 |
| 941 // static | 942 // static |
| 942 RenderWidgetHostView* | 943 RenderWidgetHostView* |
| 943 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 944 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 944 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 945 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 945 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 946 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 946 } | 947 } |
| 947 | 948 |
| 948 } // namespace content | 949 } // namespace content |
| OLD | NEW |