OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 m_webSettings = adoptPtr(new WebSettingsImpl(m_page->settings())); | 1621 m_webSettings = adoptPtr(new WebSettingsImpl(m_page->settings())); |
1622 ASSERT(m_webSettings.get()); | 1622 ASSERT(m_webSettings.get()); |
1623 return m_webSettings.get(); | 1623 return m_webSettings.get(); |
1624 } | 1624 } |
1625 | 1625 |
1626 WebString WebViewImpl::pageEncoding() const | 1626 WebString WebViewImpl::pageEncoding() const |
1627 { | 1627 { |
1628 if (!m_page.get()) | 1628 if (!m_page.get()) |
1629 return WebString(); | 1629 return WebString(); |
1630 | 1630 |
| 1631 if (!m_page->mainFrame()->document()->loader()) |
| 1632 return WebString(); |
| 1633 |
1631 return m_page->mainFrame()->document()->loader()->writer()->encoding(); | 1634 return m_page->mainFrame()->document()->loader()->writer()->encoding(); |
1632 } | 1635 } |
1633 | 1636 |
1634 void WebViewImpl::setPageEncoding(const WebString& encodingName) | 1637 void WebViewImpl::setPageEncoding(const WebString& encodingName) |
1635 { | 1638 { |
1636 if (!m_page.get()) | 1639 if (!m_page.get()) |
1637 return; | 1640 return; |
1638 | 1641 |
1639 // Only change override encoding, don't change default encoding. | 1642 // Only change override encoding, don't change default encoding. |
1640 // Note that the new encoding must be 0 if it isn't supposed to be set. | 1643 // Note that the new encoding must be 0 if it isn't supposed to be set. |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2670 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int>
(visibilityState)), isInitialState); | 2673 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int>
(visibilityState)), isInitialState); |
2671 #endif | 2674 #endif |
2672 | 2675 |
2673 #if USE(ACCELERATED_COMPOSITING) | 2676 #if USE(ACCELERATED_COMPOSITING) |
2674 if (isAcceleratedCompositingActive() && visibilityState == WebPageVisibility
StateHidden) | 2677 if (isAcceleratedCompositingActive() && visibilityState == WebPageVisibility
StateHidden) |
2675 m_layerRenderer->releaseTextures(); | 2678 m_layerRenderer->releaseTextures(); |
2676 #endif | 2679 #endif |
2677 } | 2680 } |
2678 | 2681 |
2679 } // namespace WebKit | 2682 } // namespace WebKit |
OLD | NEW |