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

Side by Side Diff: Tools/DumpRenderTree/chromium/WebViewHost.cpp

Issue 14776006: Add an interface to WebTestDelegate for auto resizing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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) 2010, 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2010, 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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 if (m_webWidget) { 837 if (m_webWidget) {
838 webView()->mainFrame()->setName(WebString()); 838 webView()->mainFrame()->setName(WebString());
839 } 839 }
840 } 840 }
841 841
842 void WebViewHost::setClientWindowRect(const WebKit::WebRect& rect) 842 void WebViewHost::setClientWindowRect(const WebKit::WebRect& rect)
843 { 843 {
844 setWindowRect(rect); 844 setWindowRect(rect);
845 } 845 }
846 846
847 void WebViewHost::enableAutoResizeMode(const WebSize& minSize, const WebSize& ma xSize)
848 {
849 webView()->enableAutoResizeMode(minSize, maxSize);
850 }
851
852 void WebViewHost::disableAutoResizeMode(const WebKit::WebSize& newSize)
853 {
854 setWindowRect(WebRect(0, 0, newSize.width, newSize.height));
855 webView()->disableAutoResizeMode();
856 webView()->resize(newSize);
857 }
858
847 bool WebViewHost::navigate(const TestNavigationEntry& entry, bool reload) 859 bool WebViewHost::navigate(const TestNavigationEntry& entry, bool reload)
848 { 860 {
849 // Get the right target frame for the entry. 861 // Get the right target frame for the entry.
850 WebFrame* frame = webView()->mainFrame(); 862 WebFrame* frame = webView()->mainFrame();
851 if (!entry.targetFrame().isEmpty()) 863 if (!entry.targetFrame().isEmpty())
852 frame = webView()->findFrameByName(entry.targetFrame()); 864 frame = webView()->findFrameByName(entry.targetFrame());
853 865
854 // TODO(mpcomplete): should we clear the target frame, or should 866 // TODO(mpcomplete): should we clear the target frame, or should
855 // back/forward navigations maintain the target frame? 867 // back/forward navigations maintain the target frame?
856 868
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 webView()->willExitFullScreen(); 1015 webView()->willExitFullScreen();
1004 webView()->didExitFullScreen(); 1016 webView()->didExitFullScreen();
1005 } 1017 }
1006 1018
1007 webkit_support::TestMediaStreamClient* WebViewHost::testMediaStreamClient() 1019 webkit_support::TestMediaStreamClient* WebViewHost::testMediaStreamClient()
1008 { 1020 {
1009 if (!m_testMediaStreamClient.get()) 1021 if (!m_testMediaStreamClient.get())
1010 m_testMediaStreamClient = adoptPtr(new webkit_support::TestMediaStreamCl ient()); 1022 m_testMediaStreamClient = adoptPtr(new webkit_support::TestMediaStreamCl ient());
1011 return m_testMediaStreamClient.get(); 1023 return m_testMediaStreamClient.get();
1012 } 1024 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698