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 2450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2461 return m_page->mainFrame()->document()->encodingName(); | 2461 return m_page->mainFrame()->document()->encodingName(); |
2462 } | 2462 } |
2463 | 2463 |
2464 void WebViewImpl::setPageEncoding(const WebString& encodingName) | 2464 void WebViewImpl::setPageEncoding(const WebString& encodingName) |
2465 { | 2465 { |
2466 if (!m_page) | 2466 if (!m_page) |
2467 return; | 2467 return; |
2468 | 2468 |
2469 // Only change override encoding, don't change default encoding. | 2469 // Only change override encoding, don't change default encoding. |
2470 // Note that the new encoding must be 0 if it isn't supposed to be set. | 2470 // Note that the new encoding must be 0 if it isn't supposed to be set. |
2471 String newEncodingName; | 2471 AtomicString newEncodingName; |
2472 if (!encodingName.isEmpty()) | 2472 if (!encodingName.isEmpty()) |
2473 newEncodingName = encodingName; | 2473 newEncodingName = encodingName; |
2474 m_page->mainFrame()->loader().reload(NormalReload, KURL(), newEncodingName); | 2474 m_page->mainFrame()->loader().reload(NormalReload, KURL(), newEncodingName); |
2475 } | 2475 } |
2476 | 2476 |
2477 bool WebViewImpl::dispatchBeforeUnloadEvent() | 2477 bool WebViewImpl::dispatchBeforeUnloadEvent() |
2478 { | 2478 { |
2479 // FIXME: This should really cause a recursive depth-first walk of all | 2479 // FIXME: This should really cause a recursive depth-first walk of all |
2480 // frames in the tree, calling each frame's onbeforeunload. At the moment, | 2480 // frames in the tree, calling each frame's onbeforeunload. At the moment, |
2481 // we're consistent with Safari 3.1, not IE/FF. | 2481 // we're consistent with Safari 3.1, not IE/FF. |
(...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4013 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4013 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4014 | 4014 |
4015 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4015 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4016 return false; | 4016 return false; |
4017 | 4017 |
4018 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4018 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4019 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4019 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4020 } | 4020 } |
4021 | 4021 |
4022 } // namespace blink | 4022 } // namespace blink |
OLD | NEW |