| 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/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 const IPC::Message& message) { | 305 const IPC::Message& message) { |
| 306 bool handled = true; | 306 bool handled = true; |
| 307 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) | 307 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) |
| 308 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) | 308 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) |
| 309 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, | 309 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, |
| 310 OnDidChangeBodyBackgroundColor) | 310 OnDidChangeBodyBackgroundColor) |
| 311 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrame, | 311 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrame, |
| 312 OnSetNeedsBeginFrame) | 312 OnSetNeedsBeginFrame) |
| 313 IPC_MESSAGE_HANDLER(ViewHostMsg_SmartClipDataExtracted, | 313 IPC_MESSAGE_HANDLER(ViewHostMsg_SmartClipDataExtracted, |
| 314 OnSmartClipDataExtracted) | 314 OnSmartClipDataExtracted) |
| 315 IPC_MESSAGE_HANDLER(ViewHostMsg_DidEnterFullscreen, OnDidEnterFullscreen) | |
| 316 IPC_MESSAGE_HANDLER(ViewHostMsg_DidExitFullscreen, OnDidExitFullscreen) | |
| 317 IPC_MESSAGE_UNHANDLED(handled = false) | 315 IPC_MESSAGE_UNHANDLED(handled = false) |
| 318 IPC_END_MESSAGE_MAP() | 316 IPC_END_MESSAGE_MAP() |
| 319 return handled; | 317 return handled; |
| 320 } | 318 } |
| 321 | 319 |
| 322 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { | 320 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { |
| 323 NOTIMPLEMENTED(); | 321 NOTIMPLEMENTED(); |
| 324 } | 322 } |
| 325 | 323 |
| 326 void RenderWidgetHostViewAndroid::InitAsPopup( | 324 void RenderWidgetHostViewAndroid::InitAsPopup( |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 } | 561 } |
| 564 } | 562 } |
| 565 | 563 |
| 566 void RenderWidgetHostViewAndroid::SetTextSurroundingSelectionCallback( | 564 void RenderWidgetHostViewAndroid::SetTextSurroundingSelectionCallback( |
| 567 const TextSurroundingSelectionCallback& callback) { | 565 const TextSurroundingSelectionCallback& callback) { |
| 568 // Only one outstanding request is allowed at any given time. | 566 // Only one outstanding request is allowed at any given time. |
| 569 DCHECK(!callback.is_null()); | 567 DCHECK(!callback.is_null()); |
| 570 text_surrounding_selection_callback_ = callback; | 568 text_surrounding_selection_callback_ = callback; |
| 571 } | 569 } |
| 572 | 570 |
| 573 void RenderWidgetHostViewAndroid::OnDidEnterFullscreen() { | |
| 574 if (content_view_core_) | |
| 575 content_view_core_->OnDidEnterFullscreen(); | |
| 576 } | |
| 577 | |
| 578 void RenderWidgetHostViewAndroid::OnDidExitFullscreen() { | |
| 579 if (content_view_core_) | |
| 580 content_view_core_->OnDidExitFullscreen(); | |
| 581 } | |
| 582 | |
| 583 void RenderWidgetHostViewAndroid::OnTextSurroundingSelectionResponse( | 571 void RenderWidgetHostViewAndroid::OnTextSurroundingSelectionResponse( |
| 584 const base::string16& content, | 572 const base::string16& content, |
| 585 size_t start_offset, | 573 size_t start_offset, |
| 586 size_t end_offset) { | 574 size_t end_offset) { |
| 587 if (text_surrounding_selection_callback_.is_null()) | 575 if (text_surrounding_selection_callback_.is_null()) |
| 588 return; | 576 return; |
| 589 text_surrounding_selection_callback_.Run(content, start_offset, end_offset); | 577 text_surrounding_selection_callback_.Run(content, start_offset, end_offset); |
| 590 text_surrounding_selection_callback_.Reset(); | 578 text_surrounding_selection_callback_.Reset(); |
| 591 } | 579 } |
| 592 | 580 |
| (...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1784 results->orientationAngle = display.RotationAsDegree(); | 1772 results->orientationAngle = display.RotationAsDegree(); |
| 1785 results->orientationType = | 1773 results->orientationType = |
| 1786 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1774 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1787 gfx::DeviceDisplayInfo info; | 1775 gfx::DeviceDisplayInfo info; |
| 1788 results->depth = info.GetBitsPerPixel(); | 1776 results->depth = info.GetBitsPerPixel(); |
| 1789 results->depthPerComponent = info.GetBitsPerComponent(); | 1777 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1790 results->isMonochrome = (results->depthPerComponent == 0); | 1778 results->isMonochrome = (results->depthPerComponent == 0); |
| 1791 } | 1779 } |
| 1792 | 1780 |
| 1793 } // namespace content | 1781 } // namespace content |
| OLD | NEW |