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