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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 bool RenderWidgetHostViewAndroid::OnMessageReceived( | 114 bool RenderWidgetHostViewAndroid::OnMessageReceived( |
115 const IPC::Message& message) { | 115 const IPC::Message& message) { |
116 bool handled = true; | 116 bool handled = true; |
117 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) | 117 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) |
118 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeBatchStateChanged_ACK, | 118 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeBatchStateChanged_ACK, |
119 OnProcessImeBatchStateAck) | 119 OnProcessImeBatchStateAck) |
120 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) | 120 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) |
121 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, | 121 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, |
122 OnDidChangeBodyBackgroundColor) | 122 OnDidChangeBodyBackgroundColor) |
| 123 IPC_MESSAGE_HANDLER(ViewHostMsg_SetVSyncNotificationEnabled, |
| 124 OnSetVSyncNotificationEnabled) |
123 IPC_MESSAGE_UNHANDLED(handled = false) | 125 IPC_MESSAGE_UNHANDLED(handled = false) |
124 IPC_END_MESSAGE_MAP() | 126 IPC_END_MESSAGE_MAP() |
125 return handled; | 127 return handled; |
126 } | 128 } |
127 | 129 |
128 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { | 130 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { |
129 NOTIMPLEMENTED(); | 131 NOTIMPLEMENTED(); |
130 } | 132 } |
131 | 133 |
132 void RenderWidgetHostViewAndroid::InitAsPopup( | 134 void RenderWidgetHostViewAndroid::InitAsPopup( |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 void RenderWidgetHostViewAndroid::OnDidChangeBodyBackgroundColor( | 380 void RenderWidgetHostViewAndroid::OnDidChangeBodyBackgroundColor( |
379 SkColor color) { | 381 SkColor color) { |
380 if (cached_background_color_ == color) | 382 if (cached_background_color_ == color) |
381 return; | 383 return; |
382 | 384 |
383 cached_background_color_ = color; | 385 cached_background_color_ = color; |
384 if (content_view_core_) | 386 if (content_view_core_) |
385 content_view_core_->OnBackgroundColorChanged(color); | 387 content_view_core_->OnBackgroundColorChanged(color); |
386 } | 388 } |
387 | 389 |
| 390 void RenderWidgetHostViewAndroid::SendVSync(base::TimeTicks frame_time) { |
| 391 host_->Send(new ViewMsg_DidVSync(host_->GetRoutingID(), frame_time)); |
| 392 } |
| 393 |
| 394 void RenderWidgetHostViewAndroid::OnSetVSyncNotificationEnabled(bool enabled) { |
| 395 // TODO(skyostil): Toggle the Java-side vsync monitor. |
| 396 } |
| 397 |
388 void RenderWidgetHostViewAndroid::OnStartContentIntent( | 398 void RenderWidgetHostViewAndroid::OnStartContentIntent( |
389 const GURL& content_url) { | 399 const GURL& content_url) { |
390 if (content_view_core_) | 400 if (content_view_core_) |
391 content_view_core_->StartContentIntent(content_url); | 401 content_view_core_->StartContentIntent(content_url); |
392 } | 402 } |
393 | 403 |
394 void RenderWidgetHostViewAndroid::ImeCancelComposition() { | 404 void RenderWidgetHostViewAndroid::ImeCancelComposition() { |
395 ime_adapter_android_.CancelComposition(); | 405 ime_adapter_android_.CancelComposition(); |
396 } | 406 } |
397 | 407 |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 // RenderWidgetHostView, public: | 808 // RenderWidgetHostView, public: |
799 | 809 |
800 // static | 810 // static |
801 RenderWidgetHostView* | 811 RenderWidgetHostView* |
802 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 812 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
803 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 813 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
804 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 814 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
805 } | 815 } |
806 | 816 |
807 } // namespace content | 817 } // namespace content |
OLD | NEW |