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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 RenderWidgetHostViewAndroid::~RenderWidgetHostViewAndroid() { | 352 RenderWidgetHostViewAndroid::~RenderWidgetHostViewAndroid() { |
353 SetContentViewCore(NULL); | 353 SetContentViewCore(NULL); |
354 DCHECK(ack_callbacks_.empty()); | 354 DCHECK(ack_callbacks_.empty()); |
355 if (resource_collection_.get()) | 355 if (resource_collection_.get()) |
356 resource_collection_->SetClient(NULL); | 356 resource_collection_->SetClient(NULL); |
357 DCHECK(!surface_factory_); | 357 DCHECK(!surface_factory_); |
358 DCHECK(surface_id_.is_null()); | 358 DCHECK(surface_id_.is_null()); |
359 } | 359 } |
360 | 360 |
361 void RenderWidgetHostViewAndroid::Blur() { | 361 void RenderWidgetHostViewAndroid::Blur() { |
362 host_->SetInputMethodActive(false); | |
363 host_->Blur(); | 362 host_->Blur(); |
364 if (overscroll_controller_) | 363 if (overscroll_controller_) |
365 overscroll_controller_->Disable(); | 364 overscroll_controller_->Disable(); |
366 } | 365 } |
367 | 366 |
368 bool RenderWidgetHostViewAndroid::OnMessageReceived( | 367 bool RenderWidgetHostViewAndroid::OnMessageReceived( |
369 const IPC::Message& message) { | 368 const IPC::Message& message) { |
370 bool handled = true; | 369 bool handled = true; |
371 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) | 370 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) |
372 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) | 371 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 | 504 |
506 void RenderWidgetHostViewAndroid::MovePluginWindows( | 505 void RenderWidgetHostViewAndroid::MovePluginWindows( |
507 const std::vector<WebPluginGeometry>& moves) { | 506 const std::vector<WebPluginGeometry>& moves) { |
508 // We don't have plugin windows on Android. Do nothing. Note: this is called | 507 // We don't have plugin windows on Android. Do nothing. Note: this is called |
509 // from RenderWidgetHost::OnUpdateRect which is itself invoked while | 508 // from RenderWidgetHost::OnUpdateRect which is itself invoked while |
510 // processing the corresponding message from Renderer. | 509 // processing the corresponding message from Renderer. |
511 } | 510 } |
512 | 511 |
513 void RenderWidgetHostViewAndroid::Focus() { | 512 void RenderWidgetHostViewAndroid::Focus() { |
514 host_->Focus(); | 513 host_->Focus(); |
515 host_->SetInputMethodActive(true); | |
516 if (overscroll_controller_) | 514 if (overscroll_controller_) |
517 overscroll_controller_->Enable(); | 515 overscroll_controller_->Enable(); |
518 if (content_view_core_) { | 516 if (content_view_core_) { |
519 WebContentsImpl* web_contents_impl = | 517 WebContentsImpl* web_contents_impl = |
520 static_cast<WebContentsImpl*>(content_view_core_->GetWebContents()); | 518 static_cast<WebContentsImpl*>(content_view_core_->GetWebContents()); |
521 if (web_contents_impl->ShowingInterstitialPage()) | 519 if (web_contents_impl->ShowingInterstitialPage()) |
522 content_view_core_->ForceUpdateImeAdapter(GetNativeImeAdapter()); | 520 content_view_core_->ForceUpdateImeAdapter(GetNativeImeAdapter()); |
523 } | 521 } |
524 } | 522 } |
525 | 523 |
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2049 results->orientationAngle = display.RotationAsDegree(); | 2047 results->orientationAngle = display.RotationAsDegree(); |
2050 results->orientationType = | 2048 results->orientationType = |
2051 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2049 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
2052 gfx::DeviceDisplayInfo info; | 2050 gfx::DeviceDisplayInfo info; |
2053 results->depth = info.GetBitsPerPixel(); | 2051 results->depth = info.GetBitsPerPixel(); |
2054 results->depthPerComponent = info.GetBitsPerComponent(); | 2052 results->depthPerComponent = info.GetBitsPerComponent(); |
2055 results->isMonochrome = (results->depthPerComponent == 0); | 2053 results->isMonochrome = (results->depthPerComponent == 0); |
2056 } | 2054 } |
2057 | 2055 |
2058 } // namespace content | 2056 } // namespace content |
OLD | NEW |