Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2479123003: WIP Add getCoalescedEvents API using vector of WebInputEvents (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 char_event.windowsKeyCode = text[i]; 1424 char_event.windowsKeyCode = text[i];
1425 char_event.nativeKeyCode = text[i]; 1425 char_event.nativeKeyCode = text[i];
1426 1426
1427 const int32_t char_start = i; 1427 const int32_t char_start = i;
1428 for (; i < iterator.array_pos(); ++i) { 1428 for (; i < iterator.array_pos(); ++i) {
1429 char_event.text[i - char_start] = text[i]; 1429 char_event.text[i - char_start] = text[i];
1430 char_event.unmodifiedText[i - char_start] = text[i]; 1430 char_event.unmodifiedText[i - char_start] = text[i];
1431 } 1431 }
1432 1432
1433 if (GetRenderWidget()->GetWebWidget()) 1433 if (GetRenderWidget()->GetWebWidget())
1434 GetRenderWidget()->GetWebWidget()->handleInputEvent(char_event); 1434 GetRenderWidget()->GetWebWidget()->handleInputEvent(
1435 char_event, std::vector<const blink::WebInputEvent*>());
1435 } 1436 }
1436 } else { 1437 } else {
1437 // Mimics the order of events sent by WebKit. 1438 // Mimics the order of events sent by WebKit.
1438 // See WebCore::Editor::setComposition() for the corresponding code. 1439 // See WebCore::Editor::setComposition() for the corresponding code.
1439 focused_pepper_plugin_->HandleCompositionEnd(text); 1440 focused_pepper_plugin_->HandleCompositionEnd(text);
1440 focused_pepper_plugin_->HandleTextInput(text); 1441 focused_pepper_plugin_->HandleTextInput(text);
1441 } 1442 }
1442 pepper_composition_text_.clear(); 1443 pepper_composition_text_.clear();
1443 } 1444 }
1444 1445
(...skipping 14 matching lines...) Expand all
1459 char_event.windowsKeyCode = text[i]; 1460 char_event.windowsKeyCode = text[i];
1460 char_event.nativeKeyCode = text[i]; 1461 char_event.nativeKeyCode = text[i];
1461 1462
1462 const int32_t char_start = i; 1463 const int32_t char_start = i;
1463 for (; i < iterator.array_pos(); ++i) { 1464 for (; i < iterator.array_pos(); ++i) {
1464 char_event.text[i - char_start] = text[i]; 1465 char_event.text[i - char_start] = text[i];
1465 char_event.unmodifiedText[i - char_start] = text[i]; 1466 char_event.unmodifiedText[i - char_start] = text[i];
1466 } 1467 }
1467 1468
1468 if (GetRenderWidget()->GetWebWidget()) 1469 if (GetRenderWidget()->GetWebWidget())
1469 GetRenderWidget()->GetWebWidget()->handleInputEvent(char_event); 1470 GetRenderWidget()->GetWebWidget()->handleInputEvent(
1471 char_event, std::vector<const blink::WebInputEvent*>());
1470 } 1472 }
1471 } else { 1473 } else {
1472 // Mimics the order of events sent by WebKit. 1474 // Mimics the order of events sent by WebKit.
1473 // See WebCore::Editor::setComposition() for the corresponding code. 1475 // See WebCore::Editor::setComposition() for the corresponding code.
1474 focused_pepper_plugin_->HandleCompositionEnd(text); 1476 focused_pepper_plugin_->HandleCompositionEnd(text);
1475 focused_pepper_plugin_->HandleTextInput(text); 1477 focused_pepper_plugin_->HandleTextInput(text);
1476 } 1478 }
1477 pepper_composition_text_.clear(); 1479 pepper_composition_text_.clear();
1478 } 1480 }
1479 #endif // defined(ENABLE_PLUGINS) 1481 #endif // defined(ENABLE_PLUGINS)
(...skipping 5149 matching lines...) Expand 10 before | Expand all | Expand 10 after
6629 // event target. Potentially a Pepper plugin will receive the event. 6631 // event target. Potentially a Pepper plugin will receive the event.
6630 // In order to tell whether a plugin gets the last mouse event and which it 6632 // In order to tell whether a plugin gets the last mouse event and which it
6631 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6633 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6632 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6634 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6633 // |pepper_last_mouse_event_target_|. 6635 // |pepper_last_mouse_event_target_|.
6634 pepper_last_mouse_event_target_ = nullptr; 6636 pepper_last_mouse_event_target_ = nullptr;
6635 #endif 6637 #endif
6636 } 6638 }
6637 6639
6638 } // namespace content 6640 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698