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

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

Issue 2826893003: Remove ScrollableArea::GetFrameViewBase and move ScheduleAnimation into subclasses. (Closed)
Patch Set: Remove UNREACHED Created 3 years, 8 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 void SetToolTip(LocalFrame& frame, 158 void SetToolTip(LocalFrame& frame,
159 const String& tooltip, 159 const String& tooltip,
160 TextDirection direction) override { 160 TextDirection direction) override {
161 DCHECK_EQ(&frame, overlay_->OverlayMainFrame()); 161 DCHECK_EQ(&frame, overlay_->OverlayMainFrame());
162 client_->SetToolTip(*overlay_->frame_impl_->GetFrame(), tooltip, direction); 162 client_->SetToolTip(*overlay_->frame_impl_->GetFrame(), tooltip, direction);
163 } 163 }
164 164
165 void InvalidateRect(const IntRect&) override { overlay_->Invalidate(); } 165 void InvalidateRect(const IntRect&) override { overlay_->Invalidate(); }
166 166
167 void ScheduleAnimation(FrameViewBase* frame_view_base) override { 167 void ScheduleAnimation(LocalFrame* frame) override {
168 if (overlay_->in_layout_) 168 if (overlay_->in_layout_)
169 return; 169 return;
170 170
171 client_->ScheduleAnimation(frame_view_base); 171 client_->ScheduleAnimation(frame);
172 } 172 }
173 173
174 private: 174 private:
175 InspectorOverlayChromeClient(ChromeClient& client, InspectorOverlay& overlay) 175 InspectorOverlayChromeClient(ChromeClient& client, InspectorOverlay& overlay)
176 : client_(&client), overlay_(&overlay) {} 176 : client_(&client), overlay_(&overlay) {}
177 177
178 Member<ChromeClient> client_; 178 Member<ChromeClient> client_;
179 Member<InspectorOverlay> overlay_; 179 Member<InspectorOverlay> overlay_;
180 }; 180 };
181 181
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 inspect_mode_ == InspectorDOMAgent::kNotSearching; 394 inspect_mode_ == InspectorDOMAgent::kNotSearching;
395 } 395 }
396 396
397 void InspectorOverlay::ScheduleUpdate() { 397 void InspectorOverlay::ScheduleUpdate() {
398 if (IsEmpty()) { 398 if (IsEmpty()) {
399 if (page_overlay_) 399 if (page_overlay_)
400 page_overlay_.reset(); 400 page_overlay_.reset();
401 return; 401 return;
402 } 402 }
403 needs_update_ = true; 403 needs_update_ = true;
404 FrameView* view = frame_impl_->GetFrameView();
405 LocalFrame* frame = frame_impl_->GetFrame(); 404 LocalFrame* frame = frame_impl_->GetFrame();
406 if (view && frame) 405 if (frame) {
407 frame->GetPage()->GetChromeClient().ScheduleAnimation(view); 406 // TODO(joelhockey): Remove this check once all tests pass.
dcheng 2017/04/19 11:26:25 I don't think I understand this comment. Presumabl
joelhockey 2017/04/19 11:33:18 Thanks for picking this up. I'll send a fix now.
407 CHECK(frame_impl_->GetFrameView());
408 frame->GetPage()->GetChromeClient().ScheduleAnimation(frame);
409 }
408 } 410 }
409 411
410 void InspectorOverlay::RebuildOverlayPage() { 412 void InspectorOverlay::RebuildOverlayPage() {
411 FrameView* view = frame_impl_->GetFrameView(); 413 FrameView* view = frame_impl_->GetFrameView();
412 LocalFrame* frame = frame_impl_->GetFrame(); 414 LocalFrame* frame = frame_impl_->GetFrame();
413 if (!view || !frame) 415 if (!view || !frame)
414 return; 416 return;
415 417
416 IntRect visible_rect_in_document = 418 IntRect visible_rect_in_document =
417 view->GetScrollableArea()->VisibleContentRect(); 419 view->GetScrollableArea()->VisibleContentRect();
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 bool InspectorOverlay::ShouldSearchForNode() { 820 bool InspectorOverlay::ShouldSearchForNode() {
819 return inspect_mode_ != InspectorDOMAgent::kNotSearching; 821 return inspect_mode_ != InspectorDOMAgent::kNotSearching;
820 } 822 }
821 823
822 void InspectorOverlay::Inspect(Node* node) { 824 void InspectorOverlay::Inspect(Node* node) {
823 if (dom_agent_) 825 if (dom_agent_)
824 dom_agent_->Inspect(node); 826 dom_agent_->Inspect(node);
825 } 827 }
826 828
827 } // namespace blink 829 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698