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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 1934703002: Fix keyboard focus for OOPIF-<webview>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nasko@ comments. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index 4fe72d3699282103799571228e14b96d304492fa..25adfc39ca8c7a53dfa9c1d91bf8c2edf477a5c0 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -434,31 +434,6 @@ class UserInteractionObserver : public WebContentsObserver {
DISALLOW_COPY_AND_ASSIGN(UserInteractionObserver);
};
-// This observer is used to wait for its owner FrameTreeNode to become focused.
-class FrameFocusedObserver : public FrameTreeNode::Observer {
- public:
- FrameFocusedObserver(FrameTreeNode* owner)
- : owner_(owner), message_loop_runner_(new MessageLoopRunner) {
- owner->AddObserver(this);
- }
-
- ~FrameFocusedObserver() override { owner_->RemoveObserver(this); }
-
- void Wait() { message_loop_runner_->Run(); }
-
- private:
- // FrameTreeNode::Observer
- void OnFrameTreeNodeFocused(FrameTreeNode* node) override {
- if (node == owner_)
- message_loop_runner_->Quit();
- }
-
- FrameTreeNode* owner_;
- scoped_refptr<MessageLoopRunner> message_loop_runner_;
-
- DISALLOW_COPY_AND_ASSIGN(FrameFocusedObserver);
-};
-
// This observer is used to wait for its owner FrameTreeNode to become deleted.
class FrameDeletedObserver : public FrameTreeNode::Observer {
public:
@@ -485,7 +460,7 @@ class FrameDeletedObserver : public FrameTreeNode::Observer {
// Helper function to focus a frame by sending it a mouse click and then
// waiting for it to become focused.
void FocusFrame(FrameTreeNode* frame) {
- FrameFocusedObserver focus_observer(frame);
+ FrameFocusedObserver focus_observer(frame->current_frame_host());
SimulateMouseClick(frame->current_frame_host()->GetRenderWidgetHost(), 1, 1);
focus_observer.Wait();
}
« no previous file with comments | « content/browser/frame_host/render_widget_host_view_guest.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698