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) |
315 IPC_MESSAGE_UNHANDLED(handled = false) | 317 IPC_MESSAGE_UNHANDLED(handled = false) |
316 IPC_END_MESSAGE_MAP() | 318 IPC_END_MESSAGE_MAP() |
317 return handled; | 319 return handled; |
318 } | 320 } |
319 | 321 |
320 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { | 322 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { |
321 NOTIMPLEMENTED(); | 323 NOTIMPLEMENTED(); |
322 } | 324 } |
323 | 325 |
324 void RenderWidgetHostViewAndroid::InitAsPopup( | 326 void RenderWidgetHostViewAndroid::InitAsPopup( |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 } | 563 } |
562 } | 564 } |
563 | 565 |
564 void RenderWidgetHostViewAndroid::SetTextSurroundingSelectionCallback( | 566 void RenderWidgetHostViewAndroid::SetTextSurroundingSelectionCallback( |
565 const TextSurroundingSelectionCallback& callback) { | 567 const TextSurroundingSelectionCallback& callback) { |
566 // Only one outstanding request is allowed at any given time. | 568 // Only one outstanding request is allowed at any given time. |
567 DCHECK(!callback.is_null()); | 569 DCHECK(!callback.is_null()); |
568 text_surrounding_selection_callback_ = callback; | 570 text_surrounding_selection_callback_ = callback; |
569 } | 571 } |
570 | 572 |
| 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 |
571 void RenderWidgetHostViewAndroid::OnTextSurroundingSelectionResponse( | 583 void RenderWidgetHostViewAndroid::OnTextSurroundingSelectionResponse( |
572 const base::string16& content, | 584 const base::string16& content, |
573 size_t start_offset, | 585 size_t start_offset, |
574 size_t end_offset) { | 586 size_t end_offset) { |
575 if (text_surrounding_selection_callback_.is_null()) | 587 if (text_surrounding_selection_callback_.is_null()) |
576 return; | 588 return; |
577 text_surrounding_selection_callback_.Run(content, start_offset, end_offset); | 589 text_surrounding_selection_callback_.Run(content, start_offset, end_offset); |
578 text_surrounding_selection_callback_.Reset(); | 590 text_surrounding_selection_callback_.Reset(); |
579 } | 591 } |
580 | 592 |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 results->orientationAngle = display.RotationAsDegree(); | 1819 results->orientationAngle = display.RotationAsDegree(); |
1808 results->orientationType = | 1820 results->orientationType = |
1809 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1821 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1810 gfx::DeviceDisplayInfo info; | 1822 gfx::DeviceDisplayInfo info; |
1811 results->depth = info.GetBitsPerPixel(); | 1823 results->depth = info.GetBitsPerPixel(); |
1812 results->depthPerComponent = info.GetBitsPerComponent(); | 1824 results->depthPerComponent = info.GetBitsPerComponent(); |
1813 results->isMonochrome = (results->depthPerComponent == 0); | 1825 results->isMonochrome = (results->depthPerComponent == 0); |
1814 } | 1826 } |
1815 | 1827 |
1816 } // namespace content | 1828 } // namespace content |
OLD | NEW |