| OLD | NEW |
| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 FrameView* view = m_overlay.overlayMainFrame()->view(); | 103 FrameView* view = m_overlay.overlayMainFrame()->view(); |
| 104 ASSERT(!view->needsLayout()); | 104 ASSERT(!view->needsLayout()); |
| 105 view->paint(&graphicsContext, IntRect(0, 0, view->width(), view->height(
))); | 105 view->paint(&graphicsContext, IntRect(0, 0, view->width(), view->height(
))); |
| 106 } | 106 } |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 InspectorOverlayImpl& m_overlay; | 109 InspectorOverlayImpl& m_overlay; |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 | 112 |
| 113 class InspectorOverlayImpl::InspectorOverlayChromeClient final: public EmptyChro
meClient { | 113 class InspectorOverlayImpl::InspectorOverlayChromeClient final : public EmptyChr
omeClient { |
| 114 public: | 114 public: |
| 115 InspectorOverlayChromeClient(ChromeClient& client, InspectorOverlayImpl& ove
rlay) | 115 static PassOwnPtrWillBeRawPtr<InspectorOverlayChromeClient> create(ChromeCli
ent& client, InspectorOverlayImpl& overlay) |
| 116 : m_client(client) | 116 { |
| 117 , m_overlay(overlay) | 117 return adoptPtrWillBeNoop(new InspectorOverlayChromeClient(client, overl
ay)); |
| 118 { } | 118 } |
| 119 |
| 120 DEFINE_INLINE_VIRTUAL_TRACE() |
| 121 { |
| 122 visitor->trace(m_client); |
| 123 visitor->trace(m_overlay); |
| 124 EmptyChromeClient::trace(visitor); |
| 125 } |
| 119 | 126 |
| 120 void setCursor(const Cursor& cursor) override | 127 void setCursor(const Cursor& cursor) override |
| 121 { | 128 { |
| 122 m_client.setCursor(cursor); | 129 m_client->setCursor(cursor); |
| 123 } | 130 } |
| 124 | 131 |
| 125 void setToolTip(const String& tooltip, TextDirection direction) override | 132 void setToolTip(const String& tooltip, TextDirection direction) override |
| 126 { | 133 { |
| 127 m_client.setToolTip(tooltip, direction); | 134 m_client->setToolTip(tooltip, direction); |
| 128 } | 135 } |
| 129 | 136 |
| 130 void invalidateRect(const IntRect&) override | 137 void invalidateRect(const IntRect&) override |
| 131 { | 138 { |
| 132 m_overlay.invalidate(); | 139 m_overlay->invalidate(); |
| 133 } | 140 } |
| 134 | 141 |
| 135 void scheduleAnimation() override | 142 void scheduleAnimation() override |
| 136 { | 143 { |
| 137 if (m_overlay.m_inLayout) | 144 if (m_overlay->m_inLayout) |
| 138 return; | 145 return; |
| 139 | 146 |
| 140 m_client.scheduleAnimation(); | 147 m_client->scheduleAnimation(); |
| 141 } | 148 } |
| 142 | 149 |
| 143 private: | 150 private: |
| 144 ChromeClient& m_client; | 151 InspectorOverlayChromeClient(ChromeClient& client, InspectorOverlayImpl& ove
rlay) |
| 145 InspectorOverlayImpl& m_overlay; | 152 : m_client(&client) |
| 153 , m_overlay(&overlay) |
| 154 { } |
| 155 |
| 156 RawPtrWillBeMember<ChromeClient> m_client; |
| 157 RawPtrWillBeMember<InspectorOverlayImpl> m_overlay; |
| 146 }; | 158 }; |
| 147 | 159 |
| 148 | 160 |
| 149 // static | 161 // static |
| 150 PassOwnPtrWillBeRawPtr<InspectorOverlay> InspectorOverlayImpl::createEmpty() | 162 PassOwnPtrWillBeRawPtr<InspectorOverlay> InspectorOverlayImpl::createEmpty() |
| 151 { | 163 { |
| 152 return adoptPtrWillBeNoop(new InspectorOverlayStub()); | 164 return adoptPtrWillBeNoop(new InspectorOverlayStub()); |
| 153 } | 165 } |
| 154 | 166 |
| 155 InspectorOverlayImpl::InspectorOverlayImpl(WebViewImpl* webViewImpl) | 167 InspectorOverlayImpl::InspectorOverlayImpl(WebViewImpl* webViewImpl) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 170 InspectorOverlayImpl::~InspectorOverlayImpl() | 182 InspectorOverlayImpl::~InspectorOverlayImpl() |
| 171 { | 183 { |
| 172 ASSERT(!m_overlayPage); | 184 ASSERT(!m_overlayPage); |
| 173 } | 185 } |
| 174 | 186 |
| 175 DEFINE_TRACE(InspectorOverlayImpl) | 187 DEFINE_TRACE(InspectorOverlayImpl) |
| 176 { | 188 { |
| 177 visitor->trace(m_highlightNode); | 189 visitor->trace(m_highlightNode); |
| 178 visitor->trace(m_eventTargetNode); | 190 visitor->trace(m_eventTargetNode); |
| 179 visitor->trace(m_overlayPage); | 191 visitor->trace(m_overlayPage); |
| 192 visitor->trace(m_overlayChromeClient); |
| 180 visitor->trace(m_overlayHost); | 193 visitor->trace(m_overlayHost); |
| 181 visitor->trace(m_listener); | 194 visitor->trace(m_listener); |
| 182 visitor->trace(m_layoutEditor); | 195 visitor->trace(m_layoutEditor); |
| 183 InspectorOverlay::trace(visitor); | 196 InspectorOverlay::trace(visitor); |
| 184 } | 197 } |
| 185 | 198 |
| 186 void InspectorOverlayImpl::invalidate() | 199 void InspectorOverlayImpl::invalidate() |
| 187 { | 200 { |
| 188 if (!m_pageOverlay) | 201 if (!m_pageOverlay) |
| 189 m_pageOverlay = PageOverlay::create(m_webViewImpl, adoptPtr(new Inspecto
rPageOverlayDelegate(*this))); | 202 m_pageOverlay = PageOverlay::create(m_webViewImpl, adoptPtr(new Inspecto
rPageOverlayDelegate(*this))); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 { | 390 { |
| 378 if (m_overlayPage) | 391 if (m_overlayPage) |
| 379 return m_overlayPage.get(); | 392 return m_overlayPage.get(); |
| 380 | 393 |
| 381 ScriptForbiddenScope::AllowUserAgentScript allowScript; | 394 ScriptForbiddenScope::AllowUserAgentScript allowScript; |
| 382 | 395 |
| 383 static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderClie
nt; | 396 static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderClie
nt; |
| 384 Page::PageClients pageClients; | 397 Page::PageClients pageClients; |
| 385 fillWithEmptyClients(pageClients); | 398 fillWithEmptyClients(pageClients); |
| 386 ASSERT(!m_overlayChromeClient); | 399 ASSERT(!m_overlayChromeClient); |
| 387 m_overlayChromeClient = adoptPtr(new InspectorOverlayChromeClient(m_webViewI
mpl->page()->chromeClient(), *this)); | 400 m_overlayChromeClient = InspectorOverlayChromeClient::create(m_webViewImpl->
page()->chromeClient(), *this); |
| 388 pageClients.chromeClient = m_overlayChromeClient.get(); | 401 pageClients.chromeClient = m_overlayChromeClient.get(); |
| 389 m_overlayPage = adoptPtrWillBeNoop(new Page(pageClients)); | 402 m_overlayPage = adoptPtrWillBeNoop(new Page(pageClients)); |
| 390 | 403 |
| 391 Settings& settings = m_webViewImpl->page()->settings(); | 404 Settings& settings = m_webViewImpl->page()->settings(); |
| 392 Settings& overlaySettings = m_overlayPage->settings(); | 405 Settings& overlaySettings = m_overlayPage->settings(); |
| 393 | 406 |
| 394 overlaySettings.genericFontFamilySettings().updateStandard(settings.genericF
ontFamilySettings().standard()); | 407 overlaySettings.genericFontFamilySettings().updateStandard(settings.genericF
ontFamilySettings().standard()); |
| 395 overlaySettings.genericFontFamilySettings().updateSerif(settings.genericFont
FamilySettings().serif()); | 408 overlaySettings.genericFontFamilySettings().updateSerif(settings.genericFont
FamilySettings().serif()); |
| 396 overlaySettings.genericFontFamilySettings().updateSansSerif(settings.generic
FontFamilySettings().sansSerif()); | 409 overlaySettings.genericFontFamilySettings().updateSansSerif(settings.generic
FontFamilySettings().sansSerif()); |
| 397 overlaySettings.genericFontFamilySettings().updateCursive(settings.genericFo
ntFamilySettings().cursive()); | 410 overlaySettings.genericFontFamilySettings().updateCursive(settings.genericFo
ntFamilySettings().cursive()); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 --m_suspendCount; | 527 --m_suspendCount; |
| 515 } | 528 } |
| 516 | 529 |
| 517 void InspectorOverlayImpl::setLayoutEditor(PassOwnPtrWillBeRawPtr<LayoutEditor>
layoutEditor) | 530 void InspectorOverlayImpl::setLayoutEditor(PassOwnPtrWillBeRawPtr<LayoutEditor>
layoutEditor) |
| 518 { | 531 { |
| 519 m_layoutEditor = layoutEditor; | 532 m_layoutEditor = layoutEditor; |
| 520 m_overlayHost->setLayoutEditorListener(m_layoutEditor.get()); | 533 m_overlayHost->setLayoutEditorListener(m_layoutEditor.get()); |
| 521 } | 534 } |
| 522 | 535 |
| 523 } // namespace blink | 536 } // namespace blink |
| OLD | NEW |