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

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

Issue 338993003: Cleanup various WebView/WebFrame APIs to properly handle remote frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove unneeded header. Created 6 years, 6 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 | Annotate | Revision Log
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 2475 matching lines...) Expand 10 before | Expand all | Expand 10 after
2486 // Only change override encoding, don't change default encoding. 2486 // Only change override encoding, don't change default encoding.
2487 // Note that the new encoding must be 0 if it isn't supposed to be set. 2487 // Note that the new encoding must be 0 if it isn't supposed to be set.
2488 AtomicString newEncodingName; 2488 AtomicString newEncodingName;
2489 if (!encodingName.isEmpty()) 2489 if (!encodingName.isEmpty())
2490 newEncodingName = encodingName; 2490 newEncodingName = encodingName;
2491 m_page->deprecatedLocalMainFrame()->loader().reload(NormalReload, KURL(), ne wEncodingName); 2491 m_page->deprecatedLocalMainFrame()->loader().reload(NormalReload, KURL(), ne wEncodingName);
2492 } 2492 }
2493 2493
2494 WebFrame* WebViewImpl::mainFrame() 2494 WebFrame* WebViewImpl::mainFrame()
2495 { 2495 {
2496 // FIXME: This should be updated so it can return both WebLocalFrames and 2496 return WebFrame::fromFrame(m_page ? m_page->mainFrame() : 0);
2497 // WebRemoteFrames. Right now, it only returns WebLocalFrames.
2498 return mainFrameImpl();
2499 } 2497 }
2500 2498
2501 WebFrame* WebViewImpl::findFrameByName( 2499 WebFrame* WebViewImpl::findFrameByName(
2502 const WebString& name, WebFrame* relativeToFrame) 2500 const WebString& name, WebFrame* relativeToFrame)
2503 { 2501 {
2504 // FIXME: Either this should only deal with WebLocalFrames or it should move to WebFrame. 2502 // FIXME: Either this should only deal with WebLocalFrames or it should move to WebFrame.
2505 if (!relativeToFrame) 2503 if (!relativeToFrame)
2506 relativeToFrame = mainFrame(); 2504 relativeToFrame = mainFrame();
2507 Frame* frame = toWebLocalFrameImpl(relativeToFrame)->frame(); 2505 Frame* frame = toWebLocalFrameImpl(relativeToFrame)->frame();
2508 frame = frame->tree().find(name); 2506 frame = frame->tree().find(name);
(...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after
4138 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4136 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4139 4137
4140 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4138 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4141 return false; 4139 return false;
4142 4140
4143 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4141 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4144 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4142 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4145 } 4143 }
4146 4144
4147 } // namespace blink 4145 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698