OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 if (m_client) { | 475 if (m_client) { |
476 setDeviceScaleFactor(m_client->screenInfo().deviceScaleFactor); | 476 setDeviceScaleFactor(m_client->screenInfo().deviceScaleFactor); |
477 setVisibilityState(m_client->visibilityState(), true); | 477 setVisibilityState(m_client->visibilityState(), true); |
478 } | 478 } |
479 | 479 |
480 initializeLayerTreeView(); | 480 initializeLayerTreeView(); |
481 | 481 |
482 m_devToolsEmulator = DevToolsEmulator::create(this); | 482 m_devToolsEmulator = DevToolsEmulator::create(this); |
483 | 483 |
484 allInstances().add(this); | 484 allInstances().add(this); |
| 485 |
| 486 m_pageImportanceSignals.setObserver(client); |
485 } | 487 } |
486 | 488 |
487 WebViewImpl::~WebViewImpl() | 489 WebViewImpl::~WebViewImpl() |
488 { | 490 { |
489 ASSERT(!m_page); | 491 ASSERT(!m_page); |
490 } | 492 } |
491 | 493 |
492 WebDevToolsAgentImpl* WebViewImpl::mainFrameDevToolsAgentImpl() | 494 WebDevToolsAgentImpl* WebViewImpl::mainFrameDevToolsAgentImpl() |
493 { | 495 { |
494 WebLocalFrameImpl* mainFrame = mainFrameImpl(); | 496 WebLocalFrameImpl* mainFrame = mainFrameImpl(); |
(...skipping 3332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3827 #if USE(DEFAULT_RENDER_THEME) | 3829 #if USE(DEFAULT_RENDER_THEME) |
3828 LayoutThemeDefault::setSelectionColors(activeBackgroundColor, activeForegrou
ndColor, inactiveBackgroundColor, inactiveForegroundColor); | 3830 LayoutThemeDefault::setSelectionColors(activeBackgroundColor, activeForegrou
ndColor, inactiveBackgroundColor, inactiveForegroundColor); |
3829 LayoutTheme::theme().platformColorsDidChange(); | 3831 LayoutTheme::theme().platformColorsDidChange(); |
3830 #endif | 3832 #endif |
3831 } | 3833 } |
3832 | 3834 |
3833 void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag
e) | 3835 void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag
e) |
3834 { | 3836 { |
3835 if (isNewNavigation && !isNavigationWithinPage) { | 3837 if (isNewNavigation && !isNavigationWithinPage) { |
3836 pageScaleConstraintsSet().setNeedsReset(true); | 3838 pageScaleConstraintsSet().setNeedsReset(true); |
3837 pageImportanceSignals().onCommitLoad(); | 3839 m_pageImportanceSignals.onCommitLoad(); |
3838 } | 3840 } |
3839 | 3841 |
3840 // Give the visual viewport's scroll layer its initial size. | 3842 // Give the visual viewport's scroll layer its initial size. |
3841 page()->frameHost().visualViewport().mainFrameDidChangeSize(); | 3843 page()->frameHost().visualViewport().mainFrameDidChangeSize(); |
3842 | 3844 |
3843 // Make sure link highlight from previous page is cleared. | 3845 // Make sure link highlight from previous page is cleared. |
3844 m_linkHighlights.clear(); | 3846 m_linkHighlights.clear(); |
3845 endActiveFlingAnimation(); | 3847 endActiveFlingAnimation(); |
3846 m_userGestureObserved = false; | 3848 m_userGestureObserved = false; |
3847 } | 3849 } |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4013 if (m_pageColorOverlay) | 4015 if (m_pageColorOverlay) |
4014 m_pageColorOverlay.clear(); | 4016 m_pageColorOverlay.clear(); |
4015 | 4017 |
4016 if (color == Color::transparent) | 4018 if (color == Color::transparent) |
4017 return; | 4019 return; |
4018 | 4020 |
4019 m_pageColorOverlay = PageOverlay::create(this, new ColorOverlay(color)); | 4021 m_pageColorOverlay = PageOverlay::create(this, new ColorOverlay(color)); |
4020 m_pageColorOverlay->update(); | 4022 m_pageColorOverlay->update(); |
4021 } | 4023 } |
4022 | 4024 |
| 4025 WebPageImportanceSignals* WebViewImpl::pageImportanceSignals() |
| 4026 { |
| 4027 return &m_pageImportanceSignals; |
| 4028 } |
| 4029 |
4023 Element* WebViewImpl::focusedElement() const | 4030 Element* WebViewImpl::focusedElement() const |
4024 { | 4031 { |
4025 Frame* frame = m_page->focusController().focusedFrame(); | 4032 Frame* frame = m_page->focusController().focusedFrame(); |
4026 if (!frame || !frame->isLocalFrame()) | 4033 if (!frame || !frame->isLocalFrame()) |
4027 return 0; | 4034 return 0; |
4028 | 4035 |
4029 Document* document = toLocalFrame(frame)->document(); | 4036 Document* document = toLocalFrame(frame)->document(); |
4030 if (!document) | 4037 if (!document) |
4031 return 0; | 4038 return 0; |
4032 | 4039 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4419 if (m_pageColorOverlay) | 4426 if (m_pageColorOverlay) |
4420 m_pageColorOverlay->update(); | 4427 m_pageColorOverlay->update(); |
4421 if (InspectorOverlayImpl* overlay = inspectorOverlay()) { | 4428 if (InspectorOverlayImpl* overlay = inspectorOverlay()) { |
4422 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); | 4429 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); |
4423 if (inspectorPageOverlay) | 4430 if (inspectorPageOverlay) |
4424 inspectorPageOverlay->update(); | 4431 inspectorPageOverlay->update(); |
4425 } | 4432 } |
4426 } | 4433 } |
4427 | 4434 |
4428 } // namespace blink | 4435 } // namespace blink |
OLD | NEW |