| 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_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 Loading... |
| 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. |
| 503 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, |
| 504 OnTextInputStateChanged) |
| 505 IPC_MESSAGE_UNHANDLED(handled = false) |
| 506 IPC_END_MESSAGE_MAP() |
| 507 return handled; |
| 508 } |
| 509 |
| 497 void RenderWidgetHostViewAura::InitAsChild( | 510 void RenderWidgetHostViewAura::InitAsChild( |
| 498 gfx::NativeView parent_view) { | 511 gfx::NativeView parent_view) { |
| 499 window_->Init(ui::LAYER_TEXTURED); | 512 window_->Init(ui::LAYER_TEXTURED); |
| 500 window_->SetName("RenderWidgetHostViewAura"); | 513 window_->SetName("RenderWidgetHostViewAura"); |
| 501 } | 514 } |
| 502 | 515 |
| 503 void RenderWidgetHostViewAura::InitAsPopup( | 516 void RenderWidgetHostViewAura::InitAsPopup( |
| 504 RenderWidgetHostView* parent_host_view, | 517 RenderWidgetHostView* parent_host_view, |
| 505 const gfx::Rect& bounds_in_screen) { | 518 const gfx::Rect& bounds_in_screen) { |
| 506 popup_parent_host_view_ = | 519 popup_parent_host_view_ = |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 text_input_type_ = type; | 910 text_input_type_ = type; |
| 898 text_input_mode_ = input_mode; | 911 text_input_mode_ = input_mode; |
| 899 can_compose_inline_ = can_compose_inline; | 912 can_compose_inline_ = can_compose_inline; |
| 900 if (GetInputMethod()) | 913 if (GetInputMethod()) |
| 901 GetInputMethod()->OnTextInputTypeChanged(this); | 914 GetInputMethod()->OnTextInputTypeChanged(this); |
| 902 if (touch_editing_client_) | 915 if (touch_editing_client_) |
| 903 touch_editing_client_->OnTextInputTypeChanged(text_input_type_); | 916 touch_editing_client_->OnTextInputTypeChanged(text_input_type_); |
| 904 } | 917 } |
| 905 } | 918 } |
| 906 | 919 |
| 920 void RenderWidgetHostViewAura::OnTextInputStateChanged( |
| 921 const ViewHostMsg_TextInputState_Params& params) { |
| 922 if (params.show_ime_if_needed && params.type != ui::TEXT_INPUT_TYPE_NONE) { |
| 923 if (GetInputMethod()) |
| 924 GetInputMethod()->ShowImeIfNeeded(); |
| 925 } |
| 926 } |
| 927 |
| 907 void RenderWidgetHostViewAura::ImeCancelComposition() { | 928 void RenderWidgetHostViewAura::ImeCancelComposition() { |
| 908 if (GetInputMethod()) | 929 if (GetInputMethod()) |
| 909 GetInputMethod()->CancelComposition(this); | 930 GetInputMethod()->CancelComposition(this); |
| 910 has_composition_text_ = false; | 931 has_composition_text_ = false; |
| 911 } | 932 } |
| 912 | 933 |
| 913 void RenderWidgetHostViewAura::ImeCompositionRangeChanged( | 934 void RenderWidgetHostViewAura::ImeCompositionRangeChanged( |
| 914 const gfx::Range& range, | 935 const gfx::Range& range, |
| 915 const std::vector<gfx::Rect>& character_bounds) { | 936 const std::vector<gfx::Rect>& character_bounds) { |
| 916 composition_character_bounds_ = character_bounds; | 937 composition_character_bounds_ = character_bounds; |
| (...skipping 2584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3501 RenderWidgetHost* widget) { | 3522 RenderWidgetHost* widget) { |
| 3502 return new RenderWidgetHostViewAura(widget); | 3523 return new RenderWidgetHostViewAura(widget); |
| 3503 } | 3524 } |
| 3504 | 3525 |
| 3505 // static | 3526 // static |
| 3506 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3527 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 3507 GetScreenInfoForWindow(results, NULL); | 3528 GetScreenInfoForWindow(results, NULL); |
| 3508 } | 3529 } |
| 3509 | 3530 |
| 3510 } // namespace content | 3531 } // namespace content |
| OLD | NEW |