OLD | NEW |
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 #include "core/editing/InputMethodController.h" | 115 #include "core/editing/InputMethodController.h" |
116 #include "core/editing/PlainTextRange.h" | 116 #include "core/editing/PlainTextRange.h" |
117 #include "core/editing/TextAffinity.h" | 117 #include "core/editing/TextAffinity.h" |
118 #include "core/editing/iterators/TextIterator.h" | 118 #include "core/editing/iterators/TextIterator.h" |
119 #include "core/editing/markers/DocumentMarkerController.h" | 119 #include "core/editing/markers/DocumentMarkerController.h" |
120 #include "core/editing/serializers/Serialization.h" | 120 #include "core/editing/serializers/Serialization.h" |
121 #include "core/editing/spellcheck/SpellChecker.h" | 121 #include "core/editing/spellcheck/SpellChecker.h" |
122 #include "core/exported/SharedWorkerRepositoryClientImpl.h" | 122 #include "core/exported/SharedWorkerRepositoryClientImpl.h" |
123 #include "core/exported/WebAssociatedURLLoaderImpl.h" | 123 #include "core/exported/WebAssociatedURLLoaderImpl.h" |
124 #include "core/exported/WebDataSourceImpl.h" | 124 #include "core/exported/WebDataSourceImpl.h" |
| 125 #include "core/exported/WebPluginContainerBase.h" |
125 #include "core/exported/WebViewBase.h" | 126 #include "core/exported/WebViewBase.h" |
126 #include "core/frame/FrameView.h" | 127 #include "core/frame/FrameView.h" |
127 #include "core/frame/LocalDOMWindow.h" | 128 #include "core/frame/LocalDOMWindow.h" |
128 #include "core/frame/PageScaleConstraintsSet.h" | 129 #include "core/frame/PageScaleConstraintsSet.h" |
129 #include "core/frame/RemoteFrame.h" | 130 #include "core/frame/RemoteFrame.h" |
130 #include "core/frame/ScreenOrientationController.h" | 131 #include "core/frame/ScreenOrientationController.h" |
131 #include "core/frame/Settings.h" | 132 #include "core/frame/Settings.h" |
132 #include "core/frame/SmartClip.h" | 133 #include "core/frame/SmartClip.h" |
133 #include "core/frame/SuspendableScriptExecutor.h" | 134 #include "core/frame/SuspendableScriptExecutor.h" |
134 #include "core/frame/UseCounter.h" | 135 #include "core/frame/UseCounter.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 #include "public/web/WebRange.h" | 225 #include "public/web/WebRange.h" |
225 #include "public/web/WebScriptSource.h" | 226 #include "public/web/WebScriptSource.h" |
226 #include "public/web/WebSerializedScriptValue.h" | 227 #include "public/web/WebSerializedScriptValue.h" |
227 #include "public/web/WebTreeScopeType.h" | 228 #include "public/web/WebTreeScopeType.h" |
228 #include "skia/ext/platform_canvas.h" | 229 #include "skia/ext/platform_canvas.h" |
229 #include "web/RemoteFrameOwner.h" | 230 #include "web/RemoteFrameOwner.h" |
230 #include "web/TextCheckerClientImpl.h" | 231 #include "web/TextCheckerClientImpl.h" |
231 #include "web/TextFinder.h" | 232 #include "web/TextFinder.h" |
232 #include "web/WebDevToolsAgentImpl.h" | 233 #include "web/WebDevToolsAgentImpl.h" |
233 #include "web/WebFrameWidgetImpl.h" | 234 #include "web/WebFrameWidgetImpl.h" |
234 #include "web/WebPluginContainerImpl.h" | |
235 #include "web/WebRemoteFrameImpl.h" | 235 #include "web/WebRemoteFrameImpl.h" |
236 | 236 |
237 namespace blink { | 237 namespace blink { |
238 | 238 |
239 static int g_frame_count = 0; | 239 static int g_frame_count = 0; |
240 | 240 |
241 static HeapVector<ScriptSourceCode> CreateSourcesVector( | 241 static HeapVector<ScriptSourceCode> CreateSourcesVector( |
242 const WebScriptSource* sources_in, | 242 const WebScriptSource* sources_in, |
243 unsigned num_sources) { | 243 unsigned num_sources) { |
244 HeapVector<ScriptSourceCode> sources; | 244 HeapVector<ScriptSourceCode> sources; |
245 sources.Append(sources_in, num_sources); | 245 sources.Append(sources_in, num_sources); |
246 return sources; | 246 return sources; |
247 } | 247 } |
248 | 248 |
249 WebPluginContainerImpl* WebLocalFrameImpl::PluginContainerFromFrame( | 249 WebPluginContainerBase* WebLocalFrameImpl::PluginContainerFromFrame( |
250 LocalFrame* frame) { | 250 LocalFrame* frame) { |
251 if (!frame) | 251 if (!frame) |
252 return 0; | 252 return 0; |
253 if (!frame->GetDocument() || !frame->GetDocument()->IsPluginDocument()) | 253 if (!frame->GetDocument() || !frame->GetDocument()->IsPluginDocument()) |
254 return 0; | 254 return 0; |
255 PluginDocument* plugin_document = ToPluginDocument(frame->GetDocument()); | 255 PluginDocument* plugin_document = ToPluginDocument(frame->GetDocument()); |
256 return ToWebPluginContainerImpl(plugin_document->GetPluginView()); | 256 return ToWebPluginContainerBase(plugin_document->GetPluginView()); |
257 } | 257 } |
258 | 258 |
259 WebPluginContainerImpl* WebLocalFrameImpl::CurrentPluginContainer( | 259 WebPluginContainerBase* WebLocalFrameImpl::CurrentPluginContainer( |
260 LocalFrame* frame, | 260 LocalFrame* frame, |
261 Node* node) { | 261 Node* node) { |
262 WebPluginContainerImpl* plugin_container = PluginContainerFromFrame(frame); | 262 WebPluginContainerBase* plugin_container = PluginContainerFromFrame(frame); |
263 if (plugin_container) | 263 if (plugin_container) |
264 return plugin_container; | 264 return plugin_container; |
265 | 265 |
266 if (!node) { | 266 if (!node) { |
267 DCHECK(frame->GetDocument()); | 267 DCHECK(frame->GetDocument()); |
268 node = frame->GetDocument()->FocusedElement(); | 268 node = frame->GetDocument()->FocusedElement(); |
269 } | 269 } |
270 return ToWebPluginContainerImpl(WebNode::PluginContainerFromNode(node)); | 270 return ToWebPluginContainerBase(WebNode::PluginContainerFromNode(node)); |
271 } | 271 } |
272 | 272 |
273 // Simple class to override some of PrintContext behavior. Some of the methods | 273 // Simple class to override some of PrintContext behavior. Some of the methods |
274 // made virtual so that they can be overridden by ChromePluginPrintContext. | 274 // made virtual so that they can be overridden by ChromePluginPrintContext. |
275 class ChromePrintContext : public PrintContext { | 275 class ChromePrintContext : public PrintContext { |
276 WTF_MAKE_NONCOPYABLE(ChromePrintContext); | 276 WTF_MAKE_NONCOPYABLE(ChromePrintContext); |
277 | 277 |
278 public: | 278 public: |
279 explicit ChromePrintContext(LocalFrame* frame) | 279 explicit ChromePrintContext(LocalFrame* frame) |
280 : PrintContext(frame), printed_page_width_(0) {} | 280 : PrintContext(frame), printed_page_width_(0) {} |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 float printed_page_width_; | 435 float printed_page_width_; |
436 float printed_page_height_; | 436 float printed_page_height_; |
437 }; | 437 }; |
438 | 438 |
439 // Simple class to override some of PrintContext behavior. This is used when | 439 // Simple class to override some of PrintContext behavior. This is used when |
440 // the frame hosts a plugin that supports custom printing. In this case, we | 440 // the frame hosts a plugin that supports custom printing. In this case, we |
441 // want to delegate all printing related calls to the plugin. | 441 // want to delegate all printing related calls to the plugin. |
442 class ChromePluginPrintContext final : public ChromePrintContext { | 442 class ChromePluginPrintContext final : public ChromePrintContext { |
443 public: | 443 public: |
444 ChromePluginPrintContext(LocalFrame* frame, | 444 ChromePluginPrintContext(LocalFrame* frame, |
445 WebPluginContainerImpl* plugin, | 445 WebPluginContainerBase* plugin, |
446 const WebPrintParams& print_params) | 446 const WebPrintParams& print_params) |
447 : ChromePrintContext(frame), | 447 : ChromePrintContext(frame), |
448 plugin_(plugin), | 448 plugin_(plugin), |
449 print_params_(print_params) {} | 449 print_params_(print_params) {} |
450 | 450 |
451 ~ChromePluginPrintContext() override {} | 451 ~ChromePluginPrintContext() override {} |
452 | 452 |
453 DEFINE_INLINE_VIRTUAL_TRACE() { | 453 DEFINE_INLINE_VIRTUAL_TRACE() { |
454 visitor->Trace(plugin_); | 454 visitor->Trace(plugin_); |
455 ChromePrintContext::Trace(visitor); | 455 ChromePrintContext::Trace(visitor); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 DisplayItemCacheSkipper skipper(builder.Context()); | 489 DisplayItemCacheSkipper skipper(builder.Context()); |
490 plugin_->PrintPage(page_number, builder.Context(), page_rect); | 490 plugin_->PrintPage(page_number, builder.Context(), page_rect); |
491 } | 491 } |
492 context.DrawRecord(builder.EndRecording()); | 492 context.DrawRecord(builder.EndRecording()); |
493 | 493 |
494 return 1.0; | 494 return 1.0; |
495 } | 495 } |
496 | 496 |
497 private: | 497 private: |
498 // Set when printing. | 498 // Set when printing. |
499 Member<WebPluginContainerImpl> plugin_; | 499 Member<WebPluginContainerBase> plugin_; |
500 WebPrintParams print_params_; | 500 WebPrintParams print_params_; |
501 }; | 501 }; |
502 | 502 |
503 static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader) { | 503 static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader) { |
504 return loader ? WebDataSourceImpl::FromDocumentLoader(loader) : 0; | 504 return loader ? WebDataSourceImpl::FromDocumentLoader(loader) : 0; |
505 } | 505 } |
506 | 506 |
507 // WebFrame ------------------------------------------------------------------- | 507 // WebFrame ------------------------------------------------------------------- |
508 | 508 |
509 int WebFrame::InstanceCount() { | 509 int WebFrame::InstanceCount() { |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 | 1055 |
1056 // Make sure the first letter is upper case. | 1056 // Make sure the first letter is upper case. |
1057 command.replace(0, 1, command.Substring(0, 1).UpperASCII()); | 1057 command.replace(0, 1, command.Substring(0, 1).UpperASCII()); |
1058 | 1058 |
1059 // Remove the trailing ':' if existing. | 1059 // Remove the trailing ':' if existing. |
1060 if (command[command.length() - 1] == UChar(':')) | 1060 if (command[command.length() - 1] == UChar(':')) |
1061 command = command.Substring(0, command.length() - 1); | 1061 command = command.Substring(0, command.length() - 1); |
1062 | 1062 |
1063 Node* plugin_lookup_context_node = | 1063 Node* plugin_lookup_context_node = |
1064 context_menu_node_ && name == "Copy" ? context_menu_node_ : nullptr; | 1064 context_menu_node_ && name == "Copy" ? context_menu_node_ : nullptr; |
1065 WebPluginContainerImpl* plugin_container = | 1065 WebPluginContainerBase* plugin_container = |
1066 CurrentPluginContainer(GetFrame(), plugin_lookup_context_node); | 1066 CurrentPluginContainer(GetFrame(), plugin_lookup_context_node); |
1067 if (plugin_container && plugin_container->ExecuteEditCommand(name)) | 1067 if (plugin_container && plugin_container->ExecuteEditCommand(name)) |
1068 return true; | 1068 return true; |
1069 | 1069 |
1070 return GetFrame()->GetEditor().ExecuteCommand(command); | 1070 return GetFrame()->GetEditor().ExecuteCommand(command); |
1071 } | 1071 } |
1072 | 1072 |
1073 bool WebLocalFrameImpl::ExecuteCommand(const WebString& name, | 1073 bool WebLocalFrameImpl::ExecuteCommand(const WebString& name, |
1074 const WebString& value) { | 1074 const WebString& value) { |
1075 DCHECK(GetFrame()); | 1075 DCHECK(GetFrame()); |
1076 | 1076 |
1077 WebPluginContainerImpl* plugin_container = CurrentPluginContainer(GetFrame()); | 1077 WebPluginContainerBase* plugin_container = CurrentPluginContainer(GetFrame()); |
1078 if (plugin_container && plugin_container->ExecuteEditCommand(name, value)) | 1078 if (plugin_container && plugin_container->ExecuteEditCommand(name, value)) |
1079 return true; | 1079 return true; |
1080 | 1080 |
1081 return GetFrame()->GetEditor().ExecuteCommand(name, value); | 1081 return GetFrame()->GetEditor().ExecuteCommand(name, value); |
1082 } | 1082 } |
1083 | 1083 |
1084 bool WebLocalFrameImpl::IsCommandEnabled(const WebString& name) const { | 1084 bool WebLocalFrameImpl::IsCommandEnabled(const WebString& name) const { |
1085 DCHECK(GetFrame()); | 1085 DCHECK(GetFrame()); |
1086 return GetFrame()->GetEditor().CreateCommand(name).IsEnabled(); | 1086 return GetFrame()->GetEditor().CreateCommand(name).IsEnabled(); |
1087 } | 1087 } |
(...skipping 27 matching lines...) Expand all Loading... |
1115 } | 1115 } |
1116 | 1116 |
1117 void WebLocalFrameImpl::RemoveSpellingMarkersUnderWords( | 1117 void WebLocalFrameImpl::RemoveSpellingMarkersUnderWords( |
1118 const WebVector<WebString>& words) { | 1118 const WebVector<WebString>& words) { |
1119 Vector<String> converted_words; | 1119 Vector<String> converted_words; |
1120 converted_words.Append(words.Data(), words.size()); | 1120 converted_words.Append(words.Data(), words.size()); |
1121 GetFrame()->RemoveSpellingMarkersUnderWords(converted_words); | 1121 GetFrame()->RemoveSpellingMarkersUnderWords(converted_words); |
1122 } | 1122 } |
1123 | 1123 |
1124 bool WebLocalFrameImpl::HasSelection() const { | 1124 bool WebLocalFrameImpl::HasSelection() const { |
1125 WebPluginContainerImpl* plugin_container = | 1125 WebPluginContainerBase* plugin_container = |
1126 PluginContainerFromFrame(GetFrame()); | 1126 PluginContainerFromFrame(GetFrame()); |
1127 if (plugin_container) | 1127 if (plugin_container) |
1128 return plugin_container->Plugin()->HasSelection(); | 1128 return plugin_container->Plugin()->HasSelection(); |
1129 | 1129 |
1130 // frame()->selection()->isNone() never returns true. | 1130 // frame()->selection()->isNone() never returns true. |
1131 return GetFrame() | 1131 return GetFrame() |
1132 ->Selection() | 1132 ->Selection() |
1133 .ComputeVisibleSelectionInDOMTreeDeprecated() | 1133 .ComputeVisibleSelectionInDOMTreeDeprecated() |
1134 .Start() != GetFrame() | 1134 .Start() != GetFrame() |
1135 ->Selection() | 1135 ->Selection() |
1136 .ComputeVisibleSelectionInDOMTreeDeprecated() | 1136 .ComputeVisibleSelectionInDOMTreeDeprecated() |
1137 .end(); | 1137 .end(); |
1138 } | 1138 } |
1139 | 1139 |
1140 WebRange WebLocalFrameImpl::SelectionRange() const { | 1140 WebRange WebLocalFrameImpl::SelectionRange() const { |
1141 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets | 1141 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets |
1142 // needs to be audited. See http://crbug.com/590369 for more details. | 1142 // needs to be audited. See http://crbug.com/590369 for more details. |
1143 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); | 1143 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); |
1144 | 1144 |
1145 return GetFrame() | 1145 return GetFrame() |
1146 ->Selection() | 1146 ->Selection() |
1147 .ComputeVisibleSelectionInDOMTreeDeprecated() | 1147 .ComputeVisibleSelectionInDOMTreeDeprecated() |
1148 .ToNormalizedEphemeralRange(); | 1148 .ToNormalizedEphemeralRange(); |
1149 } | 1149 } |
1150 | 1150 |
1151 WebString WebLocalFrameImpl::SelectionAsText() const { | 1151 WebString WebLocalFrameImpl::SelectionAsText() const { |
1152 WebPluginContainerImpl* plugin_container = | 1152 WebPluginContainerBase* plugin_container = |
1153 PluginContainerFromFrame(GetFrame()); | 1153 PluginContainerFromFrame(GetFrame()); |
1154 if (plugin_container) | 1154 if (plugin_container) |
1155 return plugin_container->Plugin()->SelectionAsText(); | 1155 return plugin_container->Plugin()->SelectionAsText(); |
1156 | 1156 |
1157 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets | 1157 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets |
1158 // needs to be audited. See http://crbug.com/590369 for more details. | 1158 // needs to be audited. See http://crbug.com/590369 for more details. |
1159 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); | 1159 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); |
1160 | 1160 |
1161 String text = GetFrame()->Selection().SelectedText( | 1161 String text = GetFrame()->Selection().SelectedText( |
1162 TextIteratorBehavior::EmitsObjectReplacementCharacterBehavior()); | 1162 TextIteratorBehavior::EmitsObjectReplacementCharacterBehavior()); |
1163 #if OS(WIN) | 1163 #if OS(WIN) |
1164 ReplaceNewlinesWithWindowsStyleNewlines(text); | 1164 ReplaceNewlinesWithWindowsStyleNewlines(text); |
1165 #endif | 1165 #endif |
1166 ReplaceNBSPWithSpace(text); | 1166 ReplaceNBSPWithSpace(text); |
1167 return text; | 1167 return text; |
1168 } | 1168 } |
1169 | 1169 |
1170 WebString WebLocalFrameImpl::SelectionAsMarkup() const { | 1170 WebString WebLocalFrameImpl::SelectionAsMarkup() const { |
1171 WebPluginContainerImpl* plugin_container = | 1171 WebPluginContainerBase* plugin_container = |
1172 PluginContainerFromFrame(GetFrame()); | 1172 PluginContainerFromFrame(GetFrame()); |
1173 if (plugin_container) | 1173 if (plugin_container) |
1174 return plugin_container->Plugin()->SelectionAsMarkup(); | 1174 return plugin_container->Plugin()->SelectionAsMarkup(); |
1175 | 1175 |
1176 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets | 1176 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets |
1177 // needs to be audited. See http://crbug.com/590369 for more details. | 1177 // needs to be audited. See http://crbug.com/590369 for more details. |
1178 // Selection normalization and markup generation require clean layout. | 1178 // Selection normalization and markup generation require clean layout. |
1179 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); | 1179 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); |
1180 | 1180 |
1181 return GetFrame()->Selection().SelectedHTMLForClipboard(); | 1181 return GetFrame()->Selection().SelectedHTMLForClipboard(); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 GetFrame()->Selection().SetCaretVisible(visible); | 1374 GetFrame()->Selection().SetCaretVisible(visible); |
1375 } | 1375 } |
1376 | 1376 |
1377 VisiblePosition WebLocalFrameImpl::VisiblePositionForViewportPoint( | 1377 VisiblePosition WebLocalFrameImpl::VisiblePositionForViewportPoint( |
1378 const WebPoint& point_in_viewport) { | 1378 const WebPoint& point_in_viewport) { |
1379 return VisiblePositionForContentsPoint( | 1379 return VisiblePositionForContentsPoint( |
1380 GetFrame()->View()->ViewportToContents(point_in_viewport), GetFrame()); | 1380 GetFrame()->View()->ViewportToContents(point_in_viewport), GetFrame()); |
1381 } | 1381 } |
1382 | 1382 |
1383 WebPlugin* WebLocalFrameImpl::FocusedPluginIfInputMethodSupported() { | 1383 WebPlugin* WebLocalFrameImpl::FocusedPluginIfInputMethodSupported() { |
1384 WebPluginContainerImpl* container = | 1384 WebPluginContainerBase* container = |
1385 WebLocalFrameImpl::CurrentPluginContainer(GetFrame()); | 1385 WebLocalFrameImpl::CurrentPluginContainer(GetFrame()); |
1386 if (container && container->SupportsInputMethod()) | 1386 if (container && container->SupportsInputMethod()) |
1387 return container->Plugin(); | 1387 return container->Plugin(); |
1388 return 0; | 1388 return 0; |
1389 } | 1389 } |
1390 | 1390 |
1391 int WebLocalFrameImpl::PrintBegin(const WebPrintParams& print_params, | 1391 int WebLocalFrameImpl::PrintBegin(const WebPrintParams& print_params, |
1392 const WebNode& constrain_to_node) { | 1392 const WebNode& constrain_to_node) { |
1393 DCHECK(!GetFrame()->GetDocument()->IsFrameSet()); | 1393 DCHECK(!GetFrame()->GetDocument()->IsFrameSet()); |
1394 WebPluginContainerImpl* plugin_container; | 1394 WebPluginContainerBase* plugin_container = nullptr; |
1395 if (constrain_to_node.IsNull()) { | 1395 if (constrain_to_node.IsNull()) { |
1396 // If this is a plugin document, check if the plugin supports its own | 1396 // If this is a plugin document, check if the plugin supports its own |
1397 // printing. If it does, we will delegate all printing to that. | 1397 // printing. If it does, we will delegate all printing to that. |
1398 plugin_container = PluginContainerFromFrame(GetFrame()); | 1398 plugin_container = PluginContainerFromFrame(GetFrame()); |
1399 } else { | 1399 } else { |
1400 // We only support printing plugin nodes for now. | 1400 // We only support printing plugin nodes for now. |
1401 plugin_container = | 1401 plugin_container = |
1402 ToWebPluginContainerImpl(constrain_to_node.PluginContainer()); | 1402 ToWebPluginContainerBase(constrain_to_node.PluginContainer()); |
1403 } | 1403 } |
1404 | 1404 |
1405 if (plugin_container && plugin_container->SupportsPaginatedPrint()) { | 1405 if (plugin_container && plugin_container->SupportsPaginatedPrint()) { |
1406 print_context_ = new ChromePluginPrintContext(GetFrame(), plugin_container, | 1406 print_context_ = new ChromePluginPrintContext(GetFrame(), plugin_container, |
1407 print_params); | 1407 print_params); |
1408 } else { | 1408 } else { |
1409 print_context_ = new ChromePrintContext(GetFrame()); | 1409 print_context_ = new ChromePrintContext(GetFrame()); |
1410 } | 1410 } |
1411 | 1411 |
1412 FloatRect rect(0, 0, | 1412 FloatRect rect(0, 0, |
(...skipping 20 matching lines...) Expand all Loading... |
1433 return print_context_->SpoolSinglePage(canvas, page); | 1433 return print_context_->SpoolSinglePage(canvas, page); |
1434 } | 1434 } |
1435 | 1435 |
1436 void WebLocalFrameImpl::PrintEnd() { | 1436 void WebLocalFrameImpl::PrintEnd() { |
1437 DCHECK(print_context_); | 1437 DCHECK(print_context_); |
1438 print_context_->EndPrintMode(); | 1438 print_context_->EndPrintMode(); |
1439 print_context_.Clear(); | 1439 print_context_.Clear(); |
1440 } | 1440 } |
1441 | 1441 |
1442 bool WebLocalFrameImpl::IsPrintScalingDisabledForPlugin(const WebNode& node) { | 1442 bool WebLocalFrameImpl::IsPrintScalingDisabledForPlugin(const WebNode& node) { |
1443 WebPluginContainerImpl* plugin_container = | 1443 WebPluginContainerBase* plugin_container = |
1444 node.IsNull() ? PluginContainerFromFrame(GetFrame()) | 1444 node.IsNull() ? PluginContainerFromFrame(GetFrame()) |
1445 : ToWebPluginContainerImpl(node.PluginContainer()); | 1445 : ToWebPluginContainerBase(node.PluginContainer()); |
1446 | 1446 |
1447 if (!plugin_container || !plugin_container->SupportsPaginatedPrint()) | 1447 if (!plugin_container || !plugin_container->SupportsPaginatedPrint()) |
1448 return false; | 1448 return false; |
1449 | 1449 |
1450 return plugin_container->IsPrintScalingDisabled(); | 1450 return plugin_container->IsPrintScalingDisabled(); |
1451 } | 1451 } |
1452 | 1452 |
1453 bool WebLocalFrameImpl::GetPrintPresetOptionsForPlugin( | 1453 bool WebLocalFrameImpl::GetPrintPresetOptionsForPlugin( |
1454 const WebNode& node, | 1454 const WebNode& node, |
1455 WebPrintPresetOptions* preset_options) { | 1455 WebPrintPresetOptions* preset_options) { |
1456 WebPluginContainerImpl* plugin_container = | 1456 WebPluginContainerBase* plugin_container = |
1457 node.IsNull() ? PluginContainerFromFrame(GetFrame()) | 1457 node.IsNull() ? PluginContainerFromFrame(GetFrame()) |
1458 : ToWebPluginContainerImpl(node.PluginContainer()); | 1458 : ToWebPluginContainerBase(node.PluginContainer()); |
1459 | 1459 |
1460 if (!plugin_container || !plugin_container->SupportsPaginatedPrint()) | 1460 if (!plugin_container || !plugin_container->SupportsPaginatedPrint()) |
1461 return false; | 1461 return false; |
1462 | 1462 |
1463 return plugin_container->GetPrintPresetOptionsFromDocument(preset_options); | 1463 return plugin_container->GetPrintPresetOptionsFromDocument(preset_options); |
1464 } | 1464 } |
1465 | 1465 |
1466 bool WebLocalFrameImpl::HasCustomPageSizeStyle(int page_index) { | 1466 bool WebLocalFrameImpl::HasCustomPageSizeStyle(int page_index) { |
1467 return GetFrame() | 1467 return GetFrame() |
1468 ->GetDocument() | 1468 ->GetDocument() |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1908 | 1908 |
1909 void WebLocalFrameImpl::DidFail(const ResourceError& error, | 1909 void WebLocalFrameImpl::DidFail(const ResourceError& error, |
1910 bool was_provisional, | 1910 bool was_provisional, |
1911 HistoryCommitType commit_type) { | 1911 HistoryCommitType commit_type) { |
1912 if (!Client()) | 1912 if (!Client()) |
1913 return; | 1913 return; |
1914 WebURLError web_error = error; | 1914 WebURLError web_error = error; |
1915 WebHistoryCommitType web_commit_type = | 1915 WebHistoryCommitType web_commit_type = |
1916 static_cast<WebHistoryCommitType>(commit_type); | 1916 static_cast<WebHistoryCommitType>(commit_type); |
1917 | 1917 |
1918 if (WebPluginContainerImpl* plugin = PluginContainerFromFrame(GetFrame())) | 1918 if (WebPluginContainerBase* plugin = PluginContainerFromFrame(GetFrame())) |
1919 plugin->DidFailLoading(error); | 1919 plugin->DidFailLoading(error); |
1920 | 1920 |
1921 if (was_provisional) | 1921 if (was_provisional) |
1922 Client()->DidFailProvisionalLoad(web_error, web_commit_type); | 1922 Client()->DidFailProvisionalLoad(web_error, web_commit_type); |
1923 else | 1923 else |
1924 Client()->DidFailLoad(web_error, web_commit_type); | 1924 Client()->DidFailLoad(web_error, web_commit_type); |
1925 } | 1925 } |
1926 | 1926 |
1927 void WebLocalFrameImpl::DidFinish() { | 1927 void WebLocalFrameImpl::DidFinish() { |
1928 if (!Client()) | 1928 if (!Client()) |
1929 return; | 1929 return; |
1930 | 1930 |
1931 if (WebPluginContainerImpl* plugin = PluginContainerFromFrame(GetFrame())) | 1931 if (WebPluginContainerBase* plugin = PluginContainerFromFrame(GetFrame())) |
1932 plugin->DidFinishLoading(); | 1932 plugin->DidFinishLoading(); |
1933 | 1933 |
1934 Client()->DidFinishLoad(); | 1934 Client()->DidFinishLoad(); |
1935 } | 1935 } |
1936 | 1936 |
1937 void WebLocalFrameImpl::SetCanHaveScrollbars(bool can_have_scrollbars) { | 1937 void WebLocalFrameImpl::SetCanHaveScrollbars(bool can_have_scrollbars) { |
1938 if (FrameView* view = GetFrameView()) | 1938 if (FrameView* view = GetFrameView()) |
1939 view->SetCanHaveScrollbars(can_have_scrollbars); | 1939 view->SetCanHaveScrollbars(can_have_scrollbars); |
1940 } | 1940 } |
1941 | 1941 |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2603 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { | 2603 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { |
2604 return *text_checker_client_; | 2604 return *text_checker_client_; |
2605 } | 2605 } |
2606 | 2606 |
2607 void WebLocalFrameImpl::SetTextCheckClient( | 2607 void WebLocalFrameImpl::SetTextCheckClient( |
2608 WebTextCheckClient* text_check_client) { | 2608 WebTextCheckClient* text_check_client) { |
2609 text_check_client_ = text_check_client; | 2609 text_check_client_ = text_check_client; |
2610 } | 2610 } |
2611 | 2611 |
2612 } // namespace blink | 2612 } // namespace blink |
OLD | NEW |