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 <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget()) | 1155 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget()) |
1156 return; | 1156 return; |
1157 | 1157 |
1158 // TODO(suzhe): convert both renderer_host and renderer to use | 1158 // TODO(suzhe): convert both renderer_host and renderer to use |
1159 // ui::CompositionText. | 1159 // ui::CompositionText. |
1160 std::vector<blink::WebCompositionUnderline> underlines; | 1160 std::vector<blink::WebCompositionUnderline> underlines; |
1161 underlines.reserve(composition.underlines.size()); | 1161 underlines.reserve(composition.underlines.size()); |
1162 for (std::vector<ui::CompositionUnderline>::const_iterator it = | 1162 for (std::vector<ui::CompositionUnderline>::const_iterator it = |
1163 composition.underlines.begin(); | 1163 composition.underlines.begin(); |
1164 it != composition.underlines.end(); ++it) { | 1164 it != composition.underlines.end(); ++it) { |
1165 underlines.push_back( | 1165 underlines.push_back(blink::WebCompositionUnderline( |
1166 blink::WebCompositionUnderline(static_cast<unsigned>(it->start_offset), | 1166 static_cast<unsigned>(it->start_offset), |
1167 static_cast<unsigned>(it->end_offset), | 1167 static_cast<unsigned>(it->end_offset), it->color, it->thick, |
1168 it->color, | 1168 it->background_color, false)); |
1169 it->thick, | |
1170 it->background_color)); | |
1171 } | 1169 } |
1172 | 1170 |
1173 // TODO(suzhe): due to a bug of webkit, we can't use selection range with | 1171 // TODO(suzhe): due to a bug of webkit, we can't use selection range with |
1174 // composition string. See: https://bugs.webkit.org/show_bug.cgi?id=37788 | 1172 // composition string. See: https://bugs.webkit.org/show_bug.cgi?id=37788 |
1175 text_input_manager_->GetActiveWidget()->ImeSetComposition( | 1173 text_input_manager_->GetActiveWidget()->ImeSetComposition( |
1176 composition.text, underlines, gfx::Range::InvalidRange(), | 1174 composition.text, underlines, gfx::Range::InvalidRange(), |
1177 composition.selection.end(), composition.selection.end()); | 1175 composition.selection.end(), composition.selection.end()); |
1178 | 1176 |
1179 has_composition_text_ = !composition.text.empty(); | 1177 has_composition_text_ = !composition.text.empty(); |
1180 } | 1178 } |
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2384 | 2382 |
2385 void RenderWidgetHostViewAura::SetPopupChild( | 2383 void RenderWidgetHostViewAura::SetPopupChild( |
2386 RenderWidgetHostViewAura* popup_child_host_view) { | 2384 RenderWidgetHostViewAura* popup_child_host_view) { |
2387 popup_child_host_view_ = popup_child_host_view; | 2385 popup_child_host_view_ = popup_child_host_view; |
2388 event_handler_->SetPopupChild( | 2386 event_handler_->SetPopupChild( |
2389 popup_child_host_view, | 2387 popup_child_host_view, |
2390 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); | 2388 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); |
2391 } | 2389 } |
2392 | 2390 |
2393 } // namespace content | 2391 } // namespace content |
OLD | NEW |