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

Side by Side Diff: webkit/glue/webframe_impl.cc

Issue 20222: Revert WebFrameImpl::ComputePageRects() rev 9258 changes (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 10 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
« no previous file with comments | « no previous file | no next file » | 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) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 #include "FrameLoadRequest.h" 90 #include "FrameLoadRequest.h"
91 #include "FrameTree.h" 91 #include "FrameTree.h"
92 #include "FrameView.h" 92 #include "FrameView.h"
93 #include "GraphicsContext.h" 93 #include "GraphicsContext.h"
94 #include "HTMLHeadElement.h" 94 #include "HTMLHeadElement.h"
95 #include "HTMLLinkElement.h" 95 #include "HTMLLinkElement.h"
96 #include "HistoryItem.h" 96 #include "HistoryItem.h"
97 #include "markup.h" 97 #include "markup.h"
98 #include "Page.h" 98 #include "Page.h"
99 #include "PlatformContextSkia.h" 99 #include "PlatformContextSkia.h"
100 #include "PrintContext.h"
101 #include "RenderFrame.h" 100 #include "RenderFrame.h"
102 #if defined(OS_WIN) 101 #if defined(OS_WIN)
103 #include "RenderThemeChromiumWin.h" 102 #include "RenderThemeChromiumWin.h"
104 #endif 103 #endif
105 #include "RenderWidget.h" 104 #include "RenderWidget.h"
106 #include "ReplaceSelectionCommand.h" 105 #include "ReplaceSelectionCommand.h"
107 #include "ResourceHandle.h" 106 #include "ResourceHandle.h"
108 #include "ResourceRequest.h" 107 #include "ResourceRequest.h"
109 #include "ScriptController.h" 108 #include "ScriptController.h"
110 #include "ScriptSourceCode.h" 109 #include "ScriptSourceCode.h"
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 NOTREACHED(); 1761 NOTREACHED();
1763 return 0; 1762 return 0;
1764 } 1763 }
1765 // In Safari, they are using: 1764 // In Safari, they are using:
1766 // (0,0) + soft margins top/left 1765 // (0,0) + soft margins top/left
1767 // (phys width, phys height) - hard margins - 1766 // (phys width, phys height) - hard margins -
1768 // soft margins top/left - soft margins right/bottom 1767 // soft margins top/left - soft margins right/bottom
1769 // TODO(maruel): Weird. We don't do that. 1768 // TODO(maruel): Weird. We don't do that.
1770 // Everything is in pixels :( 1769 // Everything is in pixels :(
1771 // pages_ and page_height are actually output parameters. 1770 // pages_ and page_height are actually output parameters.
1772 WebCore::FloatRect rect(0, 0, 1771 int page_height;
1773 » » » » » » static_cast<float>(page_size_p x.width()), 1772 WebCore::IntRect rect(0, 0, page_size_px.width(), page_size_px.height());
1774 » » » » » » static_cast<float>(page_size_p x.height())); 1773 computePageRectsForFrame(frame(), rect, 0, 0, 1.0, pages_, page_height);
1775 WebCore::PrintContext print_context(frame()); 1774 return pages_.size();
1776 float page_height;
1777 print_context.computePageRects(rect, 0, 0, 1.0, page_height);
1778 return print_context.pageCount();
1779 } 1775 }
1780 1776
1781 void WebFrameImpl::GetPageRect(int page, gfx::Rect* page_size) const { 1777 void WebFrameImpl::GetPageRect(int page, gfx::Rect* page_size) const {
1782 if (page < 0 || page >= static_cast<int>(pages_.size())) { 1778 if (page < 0 || page >= static_cast<int>(pages_.size())) {
1783 NOTREACHED(); 1779 NOTREACHED();
1784 return; 1780 return;
1785 } 1781 }
1786 *page_size = webkit_glue::FromIntRect(pages_[page]); 1782 *page_size = webkit_glue::FromIntRect(pages_[page]);
1787 } 1783 }
1788 1784
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 return password_listeners_.get(input_element); 1829 return password_listeners_.get(input_element);
1834 } 1830 }
1835 1831
1836 void WebFrameImpl::ClearPasswordListeners() { 1832 void WebFrameImpl::ClearPasswordListeners() {
1837 for (PasswordListenerMap::iterator iter = password_listeners_.begin(); 1833 for (PasswordListenerMap::iterator iter = password_listeners_.begin();
1838 iter != password_listeners_.end(); ++iter) { 1834 iter != password_listeners_.end(); ++iter) {
1839 delete iter->second; 1835 delete iter->second;
1840 } 1836 }
1841 password_listeners_.clear(); 1837 password_listeners_.clear();
1842 } 1838 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698