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 2090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2101 return; | 2101 return; |
2102 | 2102 |
2103 // ui::CompositionUnderline should be identical to | 2103 // ui::CompositionUnderline should be identical to |
2104 // WebKit::WebCompositionUnderline, so that we can do reinterpret_cast safely. | 2104 // WebKit::WebCompositionUnderline, so that we can do reinterpret_cast safely. |
2105 COMPILE_ASSERT(sizeof(ui::CompositionUnderline) == | 2105 COMPILE_ASSERT(sizeof(ui::CompositionUnderline) == |
2106 sizeof(WebKit::WebCompositionUnderline), | 2106 sizeof(WebKit::WebCompositionUnderline), |
2107 ui_CompositionUnderline__WebKit_WebCompositionUnderline_diff); | 2107 ui_CompositionUnderline__WebKit_WebCompositionUnderline_diff); |
2108 | 2108 |
2109 // TODO(suzhe): convert both renderer_host and renderer to use | 2109 // TODO(suzhe): convert both renderer_host and renderer to use |
2110 // ui::CompositionText. | 2110 // ui::CompositionText. |
2111 const std::vector<WebKit::WebCompositionUnderline>& underlines = | 2111 const std::vector<WebKit::WebCompositionUnderline>* underlines = |
2112 reinterpret_cast<const std::vector<WebKit::WebCompositionUnderline>&>( | 2112 bit_cast<const std::vector<WebKit::WebCompositionUnderline>*>( |
2113 composition.underlines); | 2113 &composition.underlines); |
2114 | 2114 |
2115 // TODO(suzhe): due to a bug of webkit, we can't use selection range with | 2115 // TODO(suzhe): due to a bug of webkit, we can't use selection range with |
2116 // composition string. See: https://bugs.webkit.org/show_bug.cgi?id=37788 | 2116 // composition string. See: https://bugs.webkit.org/show_bug.cgi?id=37788 |
2117 host_->ImeSetComposition(composition.text, underlines, | 2117 host_->ImeSetComposition(composition.text, *underlines, |
2118 composition.selection.end(), | 2118 composition.selection.end(), |
2119 composition.selection.end()); | 2119 composition.selection.end()); |
2120 | 2120 |
2121 has_composition_text_ = !composition.text.empty(); | 2121 has_composition_text_ = !composition.text.empty(); |
2122 } | 2122 } |
2123 | 2123 |
2124 void RenderWidgetHostViewAura::ConfirmCompositionText() { | 2124 void RenderWidgetHostViewAura::ConfirmCompositionText() { |
2125 if (host_ && has_composition_text_) | 2125 if (host_ && has_composition_text_) |
2126 host_->ImeConfirmComposition(string16(), ui::Range::InvalidRange(), false); | 2126 host_->ImeConfirmComposition(string16(), ui::Range::InvalidRange(), false); |
2127 has_composition_text_ = false; | 2127 has_composition_text_ = false; |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3242 RenderWidgetHost* widget) { | 3242 RenderWidgetHost* widget) { |
3243 return new RenderWidgetHostViewAura(widget); | 3243 return new RenderWidgetHostViewAura(widget); |
3244 } | 3244 } |
3245 | 3245 |
3246 // static | 3246 // static |
3247 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3247 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
3248 GetScreenInfoForWindow(results, NULL); | 3248 GetScreenInfoForWindow(results, NULL); |
3249 } | 3249 } |
3250 | 3250 |
3251 } // namespace content | 3251 } // namespace content |
OLD | NEW |