| 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 <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 } | 373 } |
| 374 | 374 |
| 375 bool RenderWidgetHostViewAndroid::OnMessageReceived( | 375 bool RenderWidgetHostViewAndroid::OnMessageReceived( |
| 376 const IPC::Message& message) { | 376 const IPC::Message& message) { |
| 377 if (IPC_MESSAGE_ID_CLASS(message.type()) == SyncCompositorMsgStart) { | 377 if (IPC_MESSAGE_ID_CLASS(message.type()) == SyncCompositorMsgStart) { |
| 378 return SyncCompositorOnMessageReceived(message); | 378 return SyncCompositorOnMessageReceived(message); |
| 379 } | 379 } |
| 380 bool handled = true; | 380 bool handled = true; |
| 381 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) | 381 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) |
| 382 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) | 382 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) |
| 383 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, | |
| 384 OnSetNeedsBeginFrames) | |
| 385 IPC_MESSAGE_HANDLER(ViewHostMsg_SmartClipDataExtracted, | 383 IPC_MESSAGE_HANDLER(ViewHostMsg_SmartClipDataExtracted, |
| 386 OnSmartClipDataExtracted) | 384 OnSmartClipDataExtracted) |
| 387 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowUnhandledTapUIIfNeeded, | 385 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowUnhandledTapUIIfNeeded, |
| 388 OnShowUnhandledTapUIIfNeeded) | 386 OnShowUnhandledTapUIIfNeeded) |
| 389 IPC_MESSAGE_UNHANDLED(handled = false) | 387 IPC_MESSAGE_UNHANDLED(handled = false) |
| 390 IPC_END_MESSAGE_MAP() | 388 IPC_END_MESSAGE_MAP() |
| 391 return handled; | 389 return handled; |
| 392 } | 390 } |
| 393 | 391 |
| 394 bool RenderWidgetHostViewAndroid::SyncCompositorOnMessageReceived( | 392 bool RenderWidgetHostViewAndroid::SyncCompositorOnMessageReceived( |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 | 656 |
| 659 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { | 657 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { |
| 660 if (cached_background_color_ == color) | 658 if (cached_background_color_ == color) |
| 661 return; | 659 return; |
| 662 | 660 |
| 663 cached_background_color_ = color; | 661 cached_background_color_ = color; |
| 664 if (content_view_core_) | 662 if (content_view_core_) |
| 665 content_view_core_->OnBackgroundColorChanged(color); | 663 content_view_core_->OnBackgroundColorChanged(color); |
| 666 } | 664 } |
| 667 | 665 |
| 668 void RenderWidgetHostViewAndroid::OnSetNeedsBeginFrames(bool enabled) { | 666 void RenderWidgetHostViewAndroid::SetNeedsBeginFrames(bool needs_begin_frames) { |
| 669 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::OnSetNeedsBeginFrames", | 667 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SetNeedsBeginFrames", |
| 670 "enabled", enabled); | 668 "needs_begin_frames", needs_begin_frames); |
| 671 if (enabled) | 669 if (needs_begin_frames) |
| 672 RequestVSyncUpdate(PERSISTENT_BEGIN_FRAME); | 670 RequestVSyncUpdate(PERSISTENT_BEGIN_FRAME); |
| 673 else | 671 else |
| 674 outstanding_vsync_requests_ &= ~PERSISTENT_BEGIN_FRAME; | 672 outstanding_vsync_requests_ &= ~PERSISTENT_BEGIN_FRAME; |
| 675 } | 673 } |
| 676 | 674 |
| 677 void RenderWidgetHostViewAndroid::OnStartContentIntent( | 675 void RenderWidgetHostViewAndroid::OnStartContentIntent( |
| 678 const GURL& content_url, bool is_main_frame) { | 676 const GURL& content_url, bool is_main_frame) { |
| 679 if (content_view_core_) | 677 if (content_view_core_) |
| 680 content_view_core_->StartContentIntent(content_url, is_main_frame); | 678 content_view_core_->StartContentIntent(content_url, is_main_frame); |
| 681 } | 679 } |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1973 case ui::MotionEvent::ACTION_UP: | 1971 case ui::MotionEvent::ACTION_UP: |
| 1974 case ui::MotionEvent::ACTION_POINTER_UP: | 1972 case ui::MotionEvent::ACTION_POINTER_UP: |
| 1975 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 1973 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", |
| 1976 delta.InMicroseconds(), 1, 1000000, 50); | 1974 delta.InMicroseconds(), 1, 1000000, 50); |
| 1977 default: | 1975 default: |
| 1978 return; | 1976 return; |
| 1979 } | 1977 } |
| 1980 } | 1978 } |
| 1981 | 1979 |
| 1982 } // namespace content | 1980 } // namespace content |
| OLD | NEW |