Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 14487003: Add a new pair of IPC categories for messages that need handling as input events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addresses feedback Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "cc/layers/layer.h" 13 #include "cc/layers/layer.h"
14 #include "cc/layers/texture_layer.h" 14 #include "cc/layers/texture_layer.h"
15 #include "cc/output/compositor_frame.h" 15 #include "cc/output/compositor_frame.h"
16 #include "cc/output/compositor_frame_ack.h" 16 #include "cc/output/compositor_frame_ack.h"
17 #include "content/browser/android/content_view_core_impl.h" 17 #include "content/browser/android/content_view_core_impl.h"
18 #include "content/browser/gpu/gpu_surface_tracker.h" 18 #include "content/browser/gpu/gpu_surface_tracker.h"
19 #include "content/browser/renderer_host/compositor_impl_android.h" 19 #include "content/browser/renderer_host/compositor_impl_android.h"
20 #include "content/browser/renderer_host/image_transport_factory_android.h" 20 #include "content/browser/renderer_host/image_transport_factory_android.h"
21 #include "content/browser/renderer_host/render_widget_host_impl.h" 21 #include "content/browser/renderer_host/render_widget_host_impl.h"
22 #include "content/browser/renderer_host/surface_texture_transport_client_android .h" 22 #include "content/browser/renderer_host/surface_texture_transport_client_android .h"
23 #include "content/common/gpu/client/gl_helper.h" 23 #include "content/common/gpu/client/gl_helper.h"
24 #include "content/common/gpu/gpu_messages.h" 24 #include "content/common/gpu/gpu_messages.h"
25 #include "content/common/input_messages.h"
25 #include "content/common/view_messages.h" 26 #include "content/common/view_messages.h"
26 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" 27 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h"
27 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL ayer.h" 28 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL ayer.h"
28 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" 29 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
29 #include "third_party/khronos/GLES2/gl2.h" 30 #include "third_party/khronos/GLES2/gl2.h"
30 #include "third_party/khronos/GLES2/gl2ext.h" 31 #include "third_party/khronos/GLES2/gl2ext.h"
31 #include "ui/gfx/android/device_display_info.h" 32 #include "ui/gfx/android/device_display_info.h"
32 #include "ui/gfx/android/java_bitmap.h" 33 #include "ui/gfx/android/java_bitmap.h"
33 #include "ui/gfx/display.h" 34 #include "ui/gfx/display.h"
34 #include "ui/gfx/screen.h" 35 #include "ui/gfx/screen.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // from RenderWidgetHost::OnUpdateRect which is itself invoked while 272 // from RenderWidgetHost::OnUpdateRect which is itself invoked while
272 // processing the corresponding message from Renderer. 273 // processing the corresponding message from Renderer.
273 } 274 }
274 275
275 void RenderWidgetHostViewAndroid::Focus() { 276 void RenderWidgetHostViewAndroid::Focus() {
276 host_->Focus(); 277 host_->Focus();
277 host_->SetInputMethodActive(true); 278 host_->SetInputMethodActive(true);
278 } 279 }
279 280
280 void RenderWidgetHostViewAndroid::Blur() { 281 void RenderWidgetHostViewAndroid::Blur() {
281 host_->Send(new ViewMsg_ExecuteEditCommand( 282 host_->Send(new InputMsg_ExecuteEditCommand(
282 host_->GetRoutingID(), "Unselect", "")); 283 host_->GetRoutingID(), "Unselect", ""));
283 host_->SetInputMethodActive(false); 284 host_->SetInputMethodActive(false);
284 host_->Blur(); 285 host_->Blur();
285 } 286 }
286 287
287 bool RenderWidgetHostViewAndroid::HasFocus() const { 288 bool RenderWidgetHostViewAndroid::HasFocus() const {
288 if (!content_view_core_) 289 if (!content_view_core_)
289 return false; // ContentViewCore not created yet. 290 return false; // ContentViewCore not created yet.
290 291
291 return content_view_core_->HasFocus(); 292 return content_view_core_->HasFocus();
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 // RenderWidgetHostView, public: 837 // RenderWidgetHostView, public:
837 838
838 // static 839 // static
839 RenderWidgetHostView* 840 RenderWidgetHostView*
840 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 841 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
841 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 842 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
842 return new RenderWidgetHostViewAndroid(rwhi, NULL); 843 return new RenderWidgetHostViewAndroid(rwhi, NULL);
843 } 844 }
844 845
845 } // namespace content 846 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698