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

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

Issue 591053002: Support print preset options for pdf document (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review feedback (comment, initialization) Created 6 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 #include "public/web/WebFindOptions.h" 181 #include "public/web/WebFindOptions.h"
182 #include "public/web/WebFormElement.h" 182 #include "public/web/WebFormElement.h"
183 #include "public/web/WebFrameClient.h" 183 #include "public/web/WebFrameClient.h"
184 #include "public/web/WebHistoryItem.h" 184 #include "public/web/WebHistoryItem.h"
185 #include "public/web/WebIconURL.h" 185 #include "public/web/WebIconURL.h"
186 #include "public/web/WebInputElement.h" 186 #include "public/web/WebInputElement.h"
187 #include "public/web/WebNode.h" 187 #include "public/web/WebNode.h"
188 #include "public/web/WebPerformance.h" 188 #include "public/web/WebPerformance.h"
189 #include "public/web/WebPlugin.h" 189 #include "public/web/WebPlugin.h"
190 #include "public/web/WebPrintParams.h" 190 #include "public/web/WebPrintParams.h"
191 #include "public/web/WebPrintPresetOptions.h"
191 #include "public/web/WebRange.h" 192 #include "public/web/WebRange.h"
192 #include "public/web/WebScriptSource.h" 193 #include "public/web/WebScriptSource.h"
193 #include "public/web/WebSecurityOrigin.h" 194 #include "public/web/WebSecurityOrigin.h"
194 #include "public/web/WebSerializedScriptValue.h" 195 #include "public/web/WebSerializedScriptValue.h"
195 #include "web/AssociatedURLLoader.h" 196 #include "web/AssociatedURLLoader.h"
196 #include "web/CompositionUnderlineVectorBuilder.h" 197 #include "web/CompositionUnderlineVectorBuilder.h"
197 #include "web/FindInPageCoordinates.h" 198 #include "web/FindInPageCoordinates.h"
198 #include "web/GeolocationClientProxy.h" 199 #include "web/GeolocationClientProxy.h"
199 #include "web/LocalFileSystemClient.h" 200 #include "web/LocalFileSystemClient.h"
200 #include "web/MIDIClientProxy.h" 201 #include "web/MIDIClientProxy.h"
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 bool WebLocalFrameImpl::isPrintScalingDisabledForPlugin(const WebNode& node) 1298 bool WebLocalFrameImpl::isPrintScalingDisabledForPlugin(const WebNode& node)
1298 { 1299 {
1299 WebPluginContainerImpl* pluginContainer = node.isNull() ? pluginContainerFr omFrame(frame()) : toWebPluginContainerImpl(node.pluginContainer()); 1300 WebPluginContainerImpl* pluginContainer = node.isNull() ? pluginContainerFr omFrame(frame()) : toWebPluginContainerImpl(node.pluginContainer());
1300 1301
1301 if (!pluginContainer || !pluginContainer->supportsPaginatedPrint()) 1302 if (!pluginContainer || !pluginContainer->supportsPaginatedPrint())
1302 return false; 1303 return false;
1303 1304
1304 return pluginContainer->isPrintScalingDisabled(); 1305 return pluginContainer->isPrintScalingDisabled();
1305 } 1306 }
1306 1307
1307 int WebLocalFrameImpl::getPrintCopiesForPlugin(const WebNode& node) 1308 bool WebLocalFrameImpl::getPrintPresetOptionsForPlugin(const WebNode& node, WebP rintPresetOptions* presetOptions)
1308 { 1309 {
1309 WebPluginContainerImpl* pluginContainer = node.isNull() ? pluginContainerFro mFrame(frame()) : toWebPluginContainerImpl(node.pluginContainer()); 1310 WebPluginContainerImpl* pluginContainer = node.isNull() ? pluginContainerFro mFrame(frame()) : toWebPluginContainerImpl(node.pluginContainer());
1310 1311
1311 if (!pluginContainer || !pluginContainer->supportsPaginatedPrint()) 1312 if (!pluginContainer || !pluginContainer->supportsPaginatedPrint())
1312 return 1; 1313 return false;
1313 1314
1314 return pluginContainer->getCopiesToPrint(); 1315 return pluginContainer->getPrintPresetOptionsFromDocument(presetOptions);
1315 } 1316 }
1316 1317
1317 bool WebLocalFrameImpl::hasCustomPageSizeStyle(int pageIndex) 1318 bool WebLocalFrameImpl::hasCustomPageSizeStyle(int pageIndex)
1318 { 1319 {
1319 return frame()->document()->styleForPage(pageIndex)->pageSizeType() != PAGE_ SIZE_AUTO; 1320 return frame()->document()->styleForPage(pageIndex)->pageSizeType() != PAGE_ SIZE_AUTO;
1320 } 1321 }
1321 1322
1322 bool WebLocalFrameImpl::isPageBoxVisible(int pageIndex) 1323 bool WebLocalFrameImpl::isPageBoxVisible(int pageIndex)
1323 { 1324 {
1324 return frame()->document()->isPageBoxVisible(pageIndex); 1325 return frame()->document()->isPageBoxVisible(pageIndex);
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1916 1917
1917 void WebLocalFrameImpl::invalidateAll() const 1918 void WebLocalFrameImpl::invalidateAll() const
1918 { 1919 {
1919 ASSERT(frame() && frame()->view()); 1920 ASSERT(frame() && frame()->view());
1920 FrameView* view = frame()->view(); 1921 FrameView* view = frame()->view();
1921 view->invalidateRect(view->frameRect()); 1922 view->invalidateRect(view->frameRect());
1922 invalidateScrollbar(); 1923 invalidateScrollbar();
1923 } 1924 }
1924 1925
1925 } // namespace blink 1926 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698