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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 2910233002: Do not fallback to FocusedOrMainFrame() in FocusedLocalFrameInWidget() (Closed)
Patch Set: Fixed a crashing test Created 3 years, 6 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 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 layer_tree_view_(nullptr), 111 layer_tree_view_(nullptr),
112 root_layer_(nullptr), 112 root_layer_(nullptr),
113 root_graphics_layer_(nullptr), 113 root_graphics_layer_(nullptr),
114 is_accelerated_compositing_active_(false), 114 is_accelerated_compositing_active_(false),
115 layer_tree_view_closed_(false), 115 layer_tree_view_closed_(false),
116 suppress_next_keypress_event_(false), 116 suppress_next_keypress_event_(false),
117 background_color_override_enabled_(false), 117 background_color_override_enabled_(false),
118 background_color_override_(Color::kTransparent), 118 background_color_override_(Color::kTransparent),
119 base_background_color_override_enabled_(false), 119 base_background_color_override_enabled_(false),
120 base_background_color_override_(Color::kTransparent), 120 base_background_color_override_(Color::kTransparent),
121 ime_accept_events_(true),
122 self_keep_alive_(this) { 121 self_keep_alive_(this) {
123 DCHECK(local_root_->GetFrame()->IsLocalRoot()); 122 DCHECK(local_root_->GetFrame()->IsLocalRoot());
124 InitializeLayerTreeView(); 123 InitializeLayerTreeView();
125 local_root_->SetFrameWidget(this); 124 local_root_->SetFrameWidget(this);
126 125
127 if (local_root->Parent()) 126 if (local_root->Parent())
128 SetBackgroundColorOverride(Color::kTransparent); 127 SetBackgroundColorOverride(Color::kTransparent);
129 } 128 }
130 129
131 WebFrameWidgetImpl::~WebFrameWidgetImpl() {} 130 WebFrameWidgetImpl::~WebFrameWidgetImpl() {}
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 const IntPoint& pos_in_root_frame) { 1180 const IntPoint& pos_in_root_frame) {
1182 IntPoint doc_point( 1181 IntPoint doc_point(
1183 local_root_->GetFrame()->View()->RootFrameToContents(pos_in_root_frame)); 1182 local_root_->GetFrame()->View()->RootFrameToContents(pos_in_root_frame));
1184 HitTestResult result = 1183 HitTestResult result =
1185 local_root_->GetFrame()->GetEventHandler().HitTestResultAtPoint( 1184 local_root_->GetFrame()->GetEventHandler().HitTestResultAtPoint(
1186 doc_point, HitTestRequest::kReadOnly | HitTestRequest::kActive); 1185 doc_point, HitTestRequest::kReadOnly | HitTestRequest::kActive);
1187 result.SetToShadowHostIfInRestrictedShadowRoot(); 1186 result.SetToShadowHostIfInRestrictedShadowRoot();
1188 return result; 1187 return result;
1189 } 1188 }
1190 1189
1191 LocalFrame* WebFrameWidgetImpl::FocusedLocalFrameInWidget() const {
1192 LocalFrame* frame = GetPage()->GetFocusController().FocusedFrame();
1193 return (frame && frame->LocalFrameRoot() == local_root_->GetFrame())
1194 ? frame
1195 : nullptr;
1196 }
1197
1198 LocalFrame* WebFrameWidgetImpl::FocusedLocalFrameAvailableForIme() const {
1199 if (!ime_accept_events_)
1200 return nullptr;
1201 return FocusedLocalFrameInWidget();
1202 }
1203
1204 } // namespace blink 1190 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698