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 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2396 // Only change override encoding, don't change default encoding. | 2396 // Only change override encoding, don't change default encoding. |
2397 // Note that the new encoding must be 0 if it isn't supposed to be set. | 2397 // Note that the new encoding must be 0 if it isn't supposed to be set. |
2398 AtomicString newEncodingName; | 2398 AtomicString newEncodingName; |
2399 if (!encodingName.isEmpty()) | 2399 if (!encodingName.isEmpty()) |
2400 newEncodingName = encodingName; | 2400 newEncodingName = encodingName; |
2401 m_page->mainFrame()->loader().reload(NormalReload, KURL(), newEncodingName); | 2401 m_page->mainFrame()->loader().reload(NormalReload, KURL(), newEncodingName); |
2402 } | 2402 } |
2403 | 2403 |
2404 void WebViewImpl::dispatchUnloadEvent() | 2404 void WebViewImpl::dispatchUnloadEvent() |
2405 { | 2405 { |
| 2406 WebFrame* frame = mainFrame(); |
| 2407 if (!frame) |
| 2408 return; |
| 2409 |
2406 // Run unload handlers. | 2410 // Run unload handlers. |
2407 m_page->mainFrame()->loader().closeURL(); | 2411 frame->dispatchUnloadEvent(); |
2408 } | 2412 } |
2409 | 2413 |
2410 WebFrame* WebViewImpl::mainFrame() | 2414 WebFrame* WebViewImpl::mainFrame() |
2411 { | 2415 { |
2412 return mainFrameImpl(); | 2416 return mainFrameImpl(); |
2413 } | 2417 } |
2414 | 2418 |
2415 WebFrame* WebViewImpl::findFrameByName( | 2419 WebFrame* WebViewImpl::findFrameByName( |
2416 const WebString& name, WebFrame* relativeToFrame) | 2420 const WebString& name, WebFrame* relativeToFrame) |
2417 { | 2421 { |
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3975 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 3979 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
3976 | 3980 |
3977 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 3981 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
3978 return false; | 3982 return false; |
3979 | 3983 |
3980 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 3984 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
3981 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 3985 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
3982 } | 3986 } |
3983 | 3987 |
3984 } // namespace blink | 3988 } // namespace blink |
OLD | NEW |