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

Side by Side Diff: Source/web/InspectorOverlayImpl.cpp

Issue 1264483002: PageOverlays: Remove PageOverlayList (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | Annotate | Revision Log
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "platform/ScriptForbiddenScope.h" 47 #include "platform/ScriptForbiddenScope.h"
48 #include "platform/graphics/GraphicsContext.h" 48 #include "platform/graphics/GraphicsContext.h"
49 #include "public/platform/Platform.h" 49 #include "public/platform/Platform.h"
50 #include "public/platform/WebData.h" 50 #include "public/platform/WebData.h"
51 #include "web/WebGraphicsContextImpl.h" 51 #include "web/WebGraphicsContextImpl.h"
52 #include "web/WebInputEventConversion.h" 52 #include "web/WebInputEventConversion.h"
53 #include "web/WebLocalFrameImpl.h" 53 #include "web/WebLocalFrameImpl.h"
54 #include "web/WebViewImpl.h" 54 #include "web/WebViewImpl.h"
55 #include <v8.h> 55 #include <v8.h>
56 56
57 namespace OverlayZOrders {
58 // Use 99 as a big z-order number so that highlight is above other overlays.
59 static const int highlight = 99;
60 }
61
62 namespace blink { 57 namespace blink {
63 58
64 namespace { 59 namespace {
65 60
66 class InspectorOverlayStub : public NoBaseWillBeGarbageCollectedFinalized<Inspec torOverlayStub>, public InspectorOverlay { 61 class InspectorOverlayStub : public NoBaseWillBeGarbageCollectedFinalized<Inspec torOverlayStub>, public InspectorOverlay {
67 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InspectorOverlayStub); 62 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InspectorOverlayStub);
68 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(InspectorOverlayStub); 63 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(InspectorOverlayStub);
69 public: 64 public:
70 InspectorOverlayStub() { } 65 InspectorOverlayStub() { }
71 DECLARE_TRACE(); 66 DECLARE_TRACE();
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 return; 166 return;
172 167
173 GraphicsContext& graphicsContext = toWebGraphicsContextImpl(context)->graphi csContext(); 168 GraphicsContext& graphicsContext = toWebGraphicsContextImpl(context)->graphi csContext();
174 FrameView* view = overlayMainFrame()->view(); 169 FrameView* view = overlayMainFrame()->view();
175 ASSERT(!view->needsLayout()); 170 ASSERT(!view->needsLayout());
176 view->paint(&graphicsContext, IntRect(0, 0, view->width(), view->height())); 171 view->paint(&graphicsContext, IntRect(0, 0, view->width(), view->height()));
177 } 172 }
178 173
179 void InspectorOverlayImpl::invalidate() 174 void InspectorOverlayImpl::invalidate()
180 { 175 {
181 m_webViewImpl->addPageOverlay(this, OverlayZOrders::highlight); 176 m_webViewImpl->addPageOverlay(this);
182 } 177 }
183 178
184 void InspectorOverlayImpl::layout() 179 void InspectorOverlayImpl::layout()
185 { 180 {
186 if (isEmpty()) 181 if (isEmpty())
187 return; 182 return;
188 183
189 TemporaryChange<bool> scoped(m_inLayout, true); 184 TemporaryChange<bool> scoped(m_inLayout, true);
190 if (m_needsUpdate) { 185 if (m_needsUpdate) {
191 m_needsUpdate = false; 186 m_needsUpdate = false;
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 } 499 }
505 500
506 void InspectorOverlayImpl::setLayoutEditor(PassOwnPtrWillBeRawPtr<LayoutEditor> layoutEditor) 501 void InspectorOverlayImpl::setLayoutEditor(PassOwnPtrWillBeRawPtr<LayoutEditor> layoutEditor)
507 { 502 {
508 m_layoutEditor = layoutEditor; 503 m_layoutEditor = layoutEditor;
509 m_overlayHost->setLayoutEditorListener(m_layoutEditor.get()); 504 m_overlayHost->setLayoutEditorListener(m_layoutEditor.get());
510 } 505 }
511 506
512 507
513 } // namespace blink 508 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698