| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 int selection_start, | 1318 int selection_start, |
| 1319 int selection_end) { | 1319 int selection_end) { |
| 1320 render_view_->OnImeSetComposition( | 1320 render_view_->OnImeSetComposition( |
| 1321 text, underlines, gfx::Range::InvalidRange(), | 1321 text, underlines, gfx::Range::InvalidRange(), |
| 1322 selection_start, selection_end); | 1322 selection_start, selection_end); |
| 1323 } | 1323 } |
| 1324 | 1324 |
| 1325 void RenderFrameImpl::SimulateImeConfirmComposition( | 1325 void RenderFrameImpl::SimulateImeConfirmComposition( |
| 1326 const base::string16& text, | 1326 const base::string16& text, |
| 1327 const gfx::Range& replacement_range) { | 1327 const gfx::Range& replacement_range) { |
| 1328 render_view_->OnImeConfirmComposition(text, replacement_range, false); | 1328 render_view_->OnImeConfirmComposition(text, replacement_range, false, 1); |
| 1329 } | 1329 } |
| 1330 | 1330 |
| 1331 void RenderFrameImpl::OnImeSetComposition( | 1331 void RenderFrameImpl::OnImeSetComposition( |
| 1332 const base::string16& text, | 1332 const base::string16& text, |
| 1333 const std::vector<blink::WebCompositionUnderline>& underlines, | 1333 const std::vector<blink::WebCompositionUnderline>& underlines, |
| 1334 int selection_start, | 1334 int selection_start, |
| 1335 int selection_end) { | 1335 int selection_end) { |
| 1336 // When a PPAPI plugin has focus, we bypass WebKit. | 1336 // When a PPAPI plugin has focus, we bypass WebKit. |
| 1337 if (!IsPepperAcceptingCompositionEvents()) { | 1337 if (!IsPepperAcceptingCompositionEvents()) { |
| 1338 pepper_composition_text_ = text; | 1338 pepper_composition_text_ = text; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1355 if (!pepper_composition_text_.empty()) { | 1355 if (!pepper_composition_text_.empty()) { |
| 1356 focused_pepper_plugin_->HandleCompositionUpdate( | 1356 focused_pepper_plugin_->HandleCompositionUpdate( |
| 1357 pepper_composition_text_, underlines, selection_start, selection_end); | 1357 pepper_composition_text_, underlines, selection_start, selection_end); |
| 1358 } | 1358 } |
| 1359 } | 1359 } |
| 1360 } | 1360 } |
| 1361 | 1361 |
| 1362 void RenderFrameImpl::OnImeConfirmComposition( | 1362 void RenderFrameImpl::OnImeConfirmComposition( |
| 1363 const base::string16& text, | 1363 const base::string16& text, |
| 1364 const gfx::Range& replacement_range, | 1364 const gfx::Range& replacement_range, |
| 1365 bool keep_selection) { | 1365 bool keep_selection, |
| 1366 int relative_cursor_pos) { |
| 1366 // When a PPAPI plugin has focus, we bypass WebKit. | 1367 // When a PPAPI plugin has focus, we bypass WebKit. |
| 1367 // Here, text.empty() has a special meaning. It means to commit the last | 1368 // Here, text.empty() has a special meaning. It means to commit the last |
| 1368 // update of composition text (see | 1369 // update of composition text (see |
| 1369 // RenderWidgetHost::ImeConfirmComposition()). | 1370 // RenderWidgetHost::ImeConfirmComposition()). |
| 1370 const base::string16& last_text = text.empty() ? pepper_composition_text_ | 1371 const base::string16& last_text = text.empty() ? pepper_composition_text_ |
| 1371 : text; | 1372 : text; |
| 1372 | 1373 |
| 1373 // last_text is empty only when both text and pepper_composition_text_ is. | 1374 // last_text is empty only when both text and pepper_composition_text_ is. |
| 1374 // Ignore it. | 1375 // Ignore it. |
| 1375 if (last_text.empty()) | 1376 if (last_text.empty()) |
| (...skipping 4955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6331 // event target. Potentially a Pepper plugin will receive the event. | 6332 // event target. Potentially a Pepper plugin will receive the event. |
| 6332 // In order to tell whether a plugin gets the last mouse event and which it | 6333 // In order to tell whether a plugin gets the last mouse event and which it |
| 6333 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6334 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6334 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6335 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6335 // |pepper_last_mouse_event_target_|. | 6336 // |pepper_last_mouse_event_target_|. |
| 6336 pepper_last_mouse_event_target_ = nullptr; | 6337 pepper_last_mouse_event_target_ = nullptr; |
| 6337 #endif | 6338 #endif |
| 6338 } | 6339 } |
| 6339 | 6340 |
| 6340 } // namespace content | 6341 } // namespace content |
| OLD | NEW |