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

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

Issue 2621303004: Keep track of coalesced events in main thread event queue (Closed)
Patch Set: Improve MainThreadEventQueue unittests Created 3 years, 11 months 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 6646 matching lines...) Expand 10 before | Expand all | Expand 10 after
6657 char_event.windowsKeyCode = text[i]; 6657 char_event.windowsKeyCode = text[i];
6658 char_event.nativeKeyCode = text[i]; 6658 char_event.nativeKeyCode = text[i];
6659 6659
6660 const int32_t char_start = i; 6660 const int32_t char_start = i;
6661 for (; i < iterator.array_pos(); ++i) { 6661 for (; i < iterator.array_pos(); ++i) {
6662 char_event.text[i - char_start] = text[i]; 6662 char_event.text[i - char_start] = text[i];
6663 char_event.unmodifiedText[i - char_start] = text[i]; 6663 char_event.unmodifiedText[i - char_start] = text[i];
6664 } 6664 }
6665 6665
6666 if (GetRenderWidget()->GetWebWidget()) 6666 if (GetRenderWidget()->GetWebWidget())
6667 GetRenderWidget()->GetWebWidget()->handleInputEvent(char_event); 6667 GetRenderWidget()->GetWebWidget()->handleInputEvent(
6668 blink::WebCoalescedInputEvent(char_event));
6668 } 6669 }
6669 } else { 6670 } else {
6670 // Mimics the order of events sent by WebKit. 6671 // Mimics the order of events sent by WebKit.
6671 // See WebCore::Editor::setComposition() for the corresponding code. 6672 // See WebCore::Editor::setComposition() for the corresponding code.
6672 focused_pepper_plugin_->HandleCompositionEnd(text); 6673 focused_pepper_plugin_->HandleCompositionEnd(text);
6673 focused_pepper_plugin_->HandleTextInput(text); 6674 focused_pepper_plugin_->HandleTextInput(text);
6674 } 6675 }
6675 pepper_composition_text_.clear(); 6676 pepper_composition_text_.clear();
6676 } 6677 }
6677 #endif // ENABLE_PLUGINS 6678 #endif // ENABLE_PLUGINS
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
6880 // event target. Potentially a Pepper plugin will receive the event. 6881 // event target. Potentially a Pepper plugin will receive the event.
6881 // In order to tell whether a plugin gets the last mouse event and which it 6882 // In order to tell whether a plugin gets the last mouse event and which it
6882 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6883 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6883 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6884 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6884 // |pepper_last_mouse_event_target_|. 6885 // |pepper_last_mouse_event_target_|.
6885 pepper_last_mouse_event_target_ = nullptr; 6886 pepper_last_mouse_event_target_ = nullptr;
6886 #endif 6887 #endif
6887 } 6888 }
6888 6889
6889 } // namespace content 6890 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698