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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 | 639 |
640 RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host) | 640 RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host) |
641 : host_(RenderWidgetHostImpl::From(host)), | 641 : host_(RenderWidgetHostImpl::From(host)), |
642 window_(new aura::Window(this)), | 642 window_(new aura::Window(this)), |
643 in_shutdown_(false), | 643 in_shutdown_(false), |
644 is_fullscreen_(false), | 644 is_fullscreen_(false), |
645 popup_parent_host_view_(NULL), | 645 popup_parent_host_view_(NULL), |
646 popup_child_host_view_(NULL), | 646 popup_child_host_view_(NULL), |
647 is_loading_(false), | 647 is_loading_(false), |
648 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), | 648 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), |
| 649 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), |
649 can_compose_inline_(true), | 650 can_compose_inline_(true), |
650 has_composition_text_(false), | 651 has_composition_text_(false), |
651 last_swapped_surface_scale_factor_(1.f), | 652 last_swapped_surface_scale_factor_(1.f), |
652 paint_canvas_(NULL), | 653 paint_canvas_(NULL), |
653 synthetic_move_sent_(false), | 654 synthetic_move_sent_(false), |
654 accelerated_compositing_state_changed_(false), | 655 accelerated_compositing_state_changed_(false), |
655 can_lock_compositor_(YES), | 656 can_lock_compositor_(YES), |
656 cursor_visibility_state_in_renderer_(UNKNOWN), | 657 cursor_visibility_state_in_renderer_(UNKNOWN), |
657 paint_observer_(NULL), | 658 paint_observer_(NULL), |
658 touch_editing_client_(NULL) { | 659 touch_editing_client_(NULL) { |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 paint_observer_->OnPageLoadComplete(); | 1036 paint_observer_->OnPageLoadComplete(); |
1036 is_loading_ = is_loading; | 1037 is_loading_ = is_loading; |
1037 UpdateCursorIfOverSelf(); | 1038 UpdateCursorIfOverSelf(); |
1038 } | 1039 } |
1039 | 1040 |
1040 void RenderWidgetHostViewAura::TextInputTypeChanged( | 1041 void RenderWidgetHostViewAura::TextInputTypeChanged( |
1041 ui::TextInputType type, | 1042 ui::TextInputType type, |
1042 bool can_compose_inline, | 1043 bool can_compose_inline, |
1043 ui::TextInputMode input_mode) { | 1044 ui::TextInputMode input_mode) { |
1044 if (text_input_type_ != type || | 1045 if (text_input_type_ != type || |
| 1046 text_input_mode_ != input_mode || |
1045 can_compose_inline_ != can_compose_inline) { | 1047 can_compose_inline_ != can_compose_inline) { |
1046 text_input_type_ = type; | 1048 text_input_type_ = type; |
| 1049 text_input_mode_ = input_mode; |
1047 can_compose_inline_ = can_compose_inline; | 1050 can_compose_inline_ = can_compose_inline; |
1048 if (GetInputMethod()) | 1051 if (GetInputMethod()) |
1049 GetInputMethod()->OnTextInputTypeChanged(this); | 1052 GetInputMethod()->OnTextInputTypeChanged(this); |
1050 if (touch_editing_client_) | 1053 if (touch_editing_client_) |
1051 touch_editing_client_->OnTextInputTypeChanged(text_input_type_); | 1054 touch_editing_client_->OnTextInputTypeChanged(text_input_type_); |
1052 } | 1055 } |
1053 } | 1056 } |
1054 | 1057 |
1055 void RenderWidgetHostViewAura::ImeCancelComposition() { | 1058 void RenderWidgetHostViewAura::ImeCancelComposition() { |
1056 if (GetInputMethod()) | 1059 if (GetInputMethod()) |
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2176 | 2179 |
2177 gfx::NativeWindow RenderWidgetHostViewAura::GetAttachedWindow() const { | 2180 gfx::NativeWindow RenderWidgetHostViewAura::GetAttachedWindow() const { |
2178 return window_; | 2181 return window_; |
2179 } | 2182 } |
2180 | 2183 |
2181 ui::TextInputType RenderWidgetHostViewAura::GetTextInputType() const { | 2184 ui::TextInputType RenderWidgetHostViewAura::GetTextInputType() const { |
2182 return text_input_type_; | 2185 return text_input_type_; |
2183 } | 2186 } |
2184 | 2187 |
2185 ui::TextInputMode RenderWidgetHostViewAura::GetTextInputMode() const { | 2188 ui::TextInputMode RenderWidgetHostViewAura::GetTextInputMode() const { |
2186 return ui::TEXT_INPUT_MODE_DEFAULT; | 2189 return text_input_mode_; |
2187 } | 2190 } |
2188 | 2191 |
2189 bool RenderWidgetHostViewAura::CanComposeInline() const { | 2192 bool RenderWidgetHostViewAura::CanComposeInline() const { |
2190 return can_compose_inline_; | 2193 return can_compose_inline_; |
2191 } | 2194 } |
2192 | 2195 |
2193 gfx::Rect RenderWidgetHostViewAura::ConvertRectToScreen(const gfx::Rect& rect) { | 2196 gfx::Rect RenderWidgetHostViewAura::ConvertRectToScreen(const gfx::Rect& rect) { |
2194 gfx::Point origin = rect.origin(); | 2197 gfx::Point origin = rect.origin(); |
2195 gfx::Point end = gfx::Point(rect.right(), rect.bottom()); | 2198 gfx::Point end = gfx::Point(rect.right(), rect.bottom()); |
2196 | 2199 |
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3258 RenderWidgetHost* widget) { | 3261 RenderWidgetHost* widget) { |
3259 return new RenderWidgetHostViewAura(widget); | 3262 return new RenderWidgetHostViewAura(widget); |
3260 } | 3263 } |
3261 | 3264 |
3262 // static | 3265 // static |
3263 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3266 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
3264 GetScreenInfoForWindow(results, NULL); | 3267 GetScreenInfoForWindow(results, NULL); |
3265 } | 3268 } |
3266 | 3269 |
3267 } // namespace content | 3270 } // namespace content |
OLD | NEW |