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

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

Issue 220233008: Move dispatchUnloadEvent to WebFrame, part 3/3. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/WebViewImpl.h ('k') | public/web/WebView.h » ('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 2383 matching lines...) Expand 10 before | Expand all | Expand 10 after
2394 return; 2394 return;
2395 2395
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()
2405 {
2406 WebFrame* frame = mainFrame();
2407 if (!frame)
2408 return;
2409
2410 // Run unload handlers.
2411 frame->dispatchUnloadEvent();
2412 }
2413
2414 WebFrame* WebViewImpl::mainFrame() 2404 WebFrame* WebViewImpl::mainFrame()
2415 { 2405 {
2416 return mainFrameImpl(); 2406 return mainFrameImpl();
2417 } 2407 }
2418 2408
2419 WebFrame* WebViewImpl::findFrameByName( 2409 WebFrame* WebViewImpl::findFrameByName(
2420 const WebString& name, WebFrame* relativeToFrame) 2410 const WebString& name, WebFrame* relativeToFrame)
2421 { 2411 {
2422 if (!relativeToFrame) 2412 if (!relativeToFrame)
2423 relativeToFrame = mainFrame(); 2413 relativeToFrame = mainFrame();
(...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after
3979 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 3969 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
3980 3970
3981 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 3971 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
3982 return false; 3972 return false;
3983 3973
3984 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 3974 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
3985 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 3975 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
3986 } 3976 }
3987 3977
3988 } // namespace blink 3978 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | public/web/WebView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698