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 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1483 if (!page) | 1483 if (!page) |
1484 return 0; | 1484 return 0; |
1485 return static_cast<WebViewImpl*>(page->chrome().client().webView()); | 1485 return static_cast<WebViewImpl*>(page->chrome().client().webView()); |
1486 } | 1486 } |
1487 | 1487 |
1488 // WebWidget ------------------------------------------------------------------ | 1488 // WebWidget ------------------------------------------------------------------ |
1489 | 1489 |
1490 void WebViewImpl::close() | 1490 void WebViewImpl::close() |
1491 { | 1491 { |
1492 if (m_page) { | 1492 if (m_page) { |
1493 // Disable all agents prior to deleting the page. | |
1494 m_page->inspectorController().inspectedPageDestroyed(); | |
1495 | |
1496 // Initiate shutdown for the entire frameset. This will cause a lot of | 1493 // Initiate shutdown for the entire frameset. This will cause a lot of |
1497 // notifications to be sent. | 1494 // notifications to be sent. |
1498 if (m_page->mainFrame()) | 1495 if (m_page->mainFrame()) |
1499 m_page->mainFrame()->loader().frameDetached(); | 1496 m_page->mainFrame()->loader().frameDetached(); |
1500 | 1497 |
1501 m_page.clear(); | 1498 m_page.clear(); |
1502 } | 1499 } |
1503 | 1500 |
1504 // Should happen after m_page.clear(). | 1501 // Should happen after m_page.clear(). |
1505 if (m_devToolsAgent) | 1502 if (m_devToolsAgent) |
(...skipping 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3998 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 3995 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
3999 | 3996 |
4000 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 3997 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4001 return false; | 3998 return false; |
4002 | 3999 |
4003 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4000 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4004 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4001 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4005 } | 4002 } |
4006 | 4003 |
4007 } // namespace blink | 4004 } // namespace blink |
OLD | NEW |