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

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

Issue 29943002: Limit display of the virtual keyboard to state changes triggered from a user gesture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extra blank line. Created 6 years, 11 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_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 software_frame_manager_.reset(new SoftwareFrameManager( 487 software_frame_manager_.reset(new SoftwareFrameManager(
488 weak_ptr_factory_.GetWeakPtr())); 488 weak_ptr_factory_.GetWeakPtr()));
489 #if defined(OS_WIN) 489 #if defined(OS_WIN)
490 plugin_parent_window_ = NULL; 490 plugin_parent_window_ = NULL;
491 #endif 491 #endif
492 } 492 }
493 493
494 //////////////////////////////////////////////////////////////////////////////// 494 ////////////////////////////////////////////////////////////////////////////////
495 // RenderWidgetHostViewAura, RenderWidgetHostView implementation: 495 // RenderWidgetHostViewAura, RenderWidgetHostView implementation:
496 496
497 bool RenderWidgetHostViewAura::OnMessageReceived(
498 const IPC::Message& message) {
499 bool handled = true;
500 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAura, message)
501 // TODO(kevers): Move to RenderWidgetHostViewImpl and consolidate IPC
502 // messages for TextInput<State|Type>Changed. Corresponding code in
503 // RenderWidgetHostViewAndroid should also be moved at the same time.
504 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged,
505 OnTextInputStateChanged)
506 IPC_MESSAGE_UNHANDLED(handled = false)
507 IPC_END_MESSAGE_MAP()
508 return handled;
509 }
510
497 void RenderWidgetHostViewAura::InitAsChild( 511 void RenderWidgetHostViewAura::InitAsChild(
498 gfx::NativeView parent_view) { 512 gfx::NativeView parent_view) {
499 window_->Init(ui::LAYER_TEXTURED); 513 window_->Init(ui::LAYER_TEXTURED);
500 window_->SetName("RenderWidgetHostViewAura"); 514 window_->SetName("RenderWidgetHostViewAura");
501 } 515 }
502 516
503 void RenderWidgetHostViewAura::InitAsPopup( 517 void RenderWidgetHostViewAura::InitAsPopup(
504 RenderWidgetHostView* parent_host_view, 518 RenderWidgetHostView* parent_host_view,
505 const gfx::Rect& bounds_in_screen) { 519 const gfx::Rect& bounds_in_screen) {
506 popup_parent_host_view_ = 520 popup_parent_host_view_ =
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 text_input_type_ = type; 911 text_input_type_ = type;
898 text_input_mode_ = input_mode; 912 text_input_mode_ = input_mode;
899 can_compose_inline_ = can_compose_inline; 913 can_compose_inline_ = can_compose_inline;
900 if (GetInputMethod()) 914 if (GetInputMethod())
901 GetInputMethod()->OnTextInputTypeChanged(this); 915 GetInputMethod()->OnTextInputTypeChanged(this);
902 if (touch_editing_client_) 916 if (touch_editing_client_)
903 touch_editing_client_->OnTextInputTypeChanged(text_input_type_); 917 touch_editing_client_->OnTextInputTypeChanged(text_input_type_);
904 } 918 }
905 } 919 }
906 920
921 void RenderWidgetHostViewAura::OnTextInputStateChanged(
922 const ViewHostMsg_TextInputState_Params& params) {
923 if (params.show_ime_if_needed && params.type != ui::TEXT_INPUT_TYPE_NONE) {
924 if (GetInputMethod())
925 GetInputMethod()->ShowImeIfNeeded();
926 }
927 }
928
907 void RenderWidgetHostViewAura::ImeCancelComposition() { 929 void RenderWidgetHostViewAura::ImeCancelComposition() {
908 if (GetInputMethod()) 930 if (GetInputMethod())
909 GetInputMethod()->CancelComposition(this); 931 GetInputMethod()->CancelComposition(this);
910 has_composition_text_ = false; 932 has_composition_text_ = false;
911 } 933 }
912 934
913 void RenderWidgetHostViewAura::ImeCompositionRangeChanged( 935 void RenderWidgetHostViewAura::ImeCompositionRangeChanged(
914 const gfx::Range& range, 936 const gfx::Range& range,
915 const std::vector<gfx::Rect>& character_bounds) { 937 const std::vector<gfx::Rect>& character_bounds) {
916 composition_character_bounds_ = character_bounds; 938 composition_character_bounds_ = character_bounds;
(...skipping 2584 matching lines...) Expand 10 before | Expand all | Expand 10 after
3501 RenderWidgetHost* widget) { 3523 RenderWidgetHost* widget) {
3502 return new RenderWidgetHostViewAura(widget); 3524 return new RenderWidgetHostViewAura(widget);
3503 } 3525 }
3504 3526
3505 // static 3527 // static
3506 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3528 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3507 GetScreenInfoForWindow(results, NULL); 3529 GetScreenInfoForWindow(results, NULL);
3508 } 3530 }
3509 3531
3510 } // namespace content 3532 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698