Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 219163005: Move dispatchUnloadEvent to WebFrame, part 1/3. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/web/WebFrameImpl.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/web/WebFrameImpl.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698