| 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 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 if (!host_) | 1340 if (!host_) |
| 1341 return; | 1341 return; |
| 1342 | 1342 |
| 1343 // TODO(suzhe): convert both renderer_host and renderer to use | 1343 // TODO(suzhe): convert both renderer_host and renderer to use |
| 1344 // ui::CompositionText. | 1344 // ui::CompositionText. |
| 1345 std::vector<blink::WebCompositionUnderline> underlines; | 1345 std::vector<blink::WebCompositionUnderline> underlines; |
| 1346 underlines.reserve(composition.underlines.size()); | 1346 underlines.reserve(composition.underlines.size()); |
| 1347 for (std::vector<ui::CompositionUnderline>::const_iterator it = | 1347 for (std::vector<ui::CompositionUnderline>::const_iterator it = |
| 1348 composition.underlines.begin(); | 1348 composition.underlines.begin(); |
| 1349 it != composition.underlines.end(); ++it) { | 1349 it != composition.underlines.end(); ++it) { |
| 1350 underlines.push_back(blink::WebCompositionUnderline(it->start_offset, | 1350 underlines.push_back( |
| 1351 it->end_offset, | 1351 blink::WebCompositionUnderline(static_cast<unsigned>(it->start_offset), |
| 1352 it->color, | 1352 static_cast<unsigned>(it->end_offset), |
| 1353 it->thick)); | 1353 it->color, |
| 1354 it->thick, |
| 1355 it->background_color)); |
| 1354 } | 1356 } |
| 1355 | 1357 |
| 1356 // TODO(suzhe): due to a bug of webkit, we can't use selection range with | 1358 // TODO(suzhe): due to a bug of webkit, we can't use selection range with |
| 1357 // composition string. See: https://bugs.webkit.org/show_bug.cgi?id=37788 | 1359 // composition string. See: https://bugs.webkit.org/show_bug.cgi?id=37788 |
| 1358 host_->ImeSetComposition(composition.text, underlines, | 1360 host_->ImeSetComposition(composition.text, underlines, |
| 1359 composition.selection.end(), | 1361 composition.selection.end(), |
| 1360 composition.selection.end()); | 1362 composition.selection.end()); |
| 1361 | 1363 |
| 1362 has_composition_text_ = !composition.text.empty(); | 1364 has_composition_text_ = !composition.text.empty(); |
| 1363 } | 1365 } |
| (...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2456 | 2458 |
| 2457 //////////////////////////////////////////////////////////////////////////////// | 2459 //////////////////////////////////////////////////////////////////////////////// |
| 2458 // RenderWidgetHostViewBase, public: | 2460 // RenderWidgetHostViewBase, public: |
| 2459 | 2461 |
| 2460 // static | 2462 // static |
| 2461 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2463 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 2462 GetScreenInfoForWindow(results, NULL); | 2464 GetScreenInfoForWindow(results, NULL); |
| 2463 } | 2465 } |
| 2464 | 2466 |
| 2465 } // namespace content | 2467 } // namespace content |
| OLD | NEW |