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

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

Issue 2888283004: Revert of Introduce WebPluginContainerBase to abstract WebPluginContainerImpl. (Closed)
Patch Set: Created 3 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
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
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"
126 #include "core/exported/WebViewBase.h" 125 #include "core/exported/WebViewBase.h"
127 #include "core/frame/FrameView.h" 126 #include "core/frame/FrameView.h"
128 #include "core/frame/LocalDOMWindow.h" 127 #include "core/frame/LocalDOMWindow.h"
129 #include "core/frame/PageScaleConstraintsSet.h" 128 #include "core/frame/PageScaleConstraintsSet.h"
130 #include "core/frame/RemoteFrame.h" 129 #include "core/frame/RemoteFrame.h"
131 #include "core/frame/ScreenOrientationController.h" 130 #include "core/frame/ScreenOrientationController.h"
132 #include "core/frame/Settings.h" 131 #include "core/frame/Settings.h"
133 #include "core/frame/SmartClip.h" 132 #include "core/frame/SmartClip.h"
134 #include "core/frame/SuspendableScriptExecutor.h" 133 #include "core/frame/SuspendableScriptExecutor.h"
135 #include "core/frame/UseCounter.h" 134 #include "core/frame/UseCounter.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 #include "public/web/WebRange.h" 224 #include "public/web/WebRange.h"
226 #include "public/web/WebScriptSource.h" 225 #include "public/web/WebScriptSource.h"
227 #include "public/web/WebSerializedScriptValue.h" 226 #include "public/web/WebSerializedScriptValue.h"
228 #include "public/web/WebTreeScopeType.h" 227 #include "public/web/WebTreeScopeType.h"
229 #include "skia/ext/platform_canvas.h" 228 #include "skia/ext/platform_canvas.h"
230 #include "web/RemoteFrameOwner.h" 229 #include "web/RemoteFrameOwner.h"
231 #include "web/TextCheckerClientImpl.h" 230 #include "web/TextCheckerClientImpl.h"
232 #include "web/TextFinder.h" 231 #include "web/TextFinder.h"
233 #include "web/WebDevToolsAgentImpl.h" 232 #include "web/WebDevToolsAgentImpl.h"
234 #include "web/WebFrameWidgetImpl.h" 233 #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 WebPluginContainerBase* WebLocalFrameImpl::PluginContainerFromFrame( 249 WebPluginContainerImpl* 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 ToWebPluginContainerBase(plugin_document->GetPluginView()); 256 return ToWebPluginContainerImpl(plugin_document->GetPluginView());
257 } 257 }
258 258
259 WebPluginContainerBase* WebLocalFrameImpl::CurrentPluginContainer( 259 WebPluginContainerImpl* WebLocalFrameImpl::CurrentPluginContainer(
260 LocalFrame* frame, 260 LocalFrame* frame,
261 Node* node) { 261 Node* node) {
262 WebPluginContainerBase* plugin_container = PluginContainerFromFrame(frame); 262 WebPluginContainerImpl* 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 ToWebPluginContainerBase(WebNode::PluginContainerFromNode(node)); 270 return ToWebPluginContainerImpl(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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 float printed_page_width_; 437 float printed_page_width_;
438 float printed_page_height_; 438 float printed_page_height_;
439 }; 439 };
440 440
441 // Simple class to override some of PrintContext behavior. This is used when 441 // Simple class to override some of PrintContext behavior. This is used when
442 // the frame hosts a plugin that supports custom printing. In this case, we 442 // the frame hosts a plugin that supports custom printing. In this case, we
443 // want to delegate all printing related calls to the plugin. 443 // want to delegate all printing related calls to the plugin.
444 class ChromePluginPrintContext final : public ChromePrintContext { 444 class ChromePluginPrintContext final : public ChromePrintContext {
445 public: 445 public:
446 ChromePluginPrintContext(LocalFrame* frame, 446 ChromePluginPrintContext(LocalFrame* frame,
447 WebPluginContainerBase* plugin, 447 WebPluginContainerImpl* plugin,
448 const WebPrintParams& print_params) 448 const WebPrintParams& print_params)
449 : ChromePrintContext(frame), 449 : ChromePrintContext(frame),
450 plugin_(plugin), 450 plugin_(plugin),
451 print_params_(print_params) {} 451 print_params_(print_params) {}
452 452
453 ~ChromePluginPrintContext() override {} 453 ~ChromePluginPrintContext() override {}
454 454
455 DEFINE_INLINE_VIRTUAL_TRACE() { 455 DEFINE_INLINE_VIRTUAL_TRACE() {
456 visitor->Trace(plugin_); 456 visitor->Trace(plugin_);
457 ChromePrintContext::Trace(visitor); 457 ChromePrintContext::Trace(visitor);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 DisplayItemCacheSkipper skipper(builder.Context()); 495 DisplayItemCacheSkipper skipper(builder.Context());
496 plugin_->PrintPage(page_number, builder.Context(), page_rect); 496 plugin_->PrintPage(page_number, builder.Context(), page_rect);
497 } 497 }
498 context.DrawRecord(builder.EndRecording()); 498 context.DrawRecord(builder.EndRecording());
499 499
500 return 1.0; 500 return 1.0;
501 } 501 }
502 502
503 private: 503 private:
504 // Set when printing. 504 // Set when printing.
505 Member<WebPluginContainerBase> plugin_; 505 Member<WebPluginContainerImpl> plugin_;
506 WebPrintParams print_params_; 506 WebPrintParams print_params_;
507 }; 507 };
508 508
509 static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader) { 509 static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader) {
510 return loader ? WebDataSourceImpl::FromDocumentLoader(loader) : 0; 510 return loader ? WebDataSourceImpl::FromDocumentLoader(loader) : 0;
511 } 511 }
512 512
513 // WebFrame ------------------------------------------------------------------- 513 // WebFrame -------------------------------------------------------------------
514 514
515 int WebFrame::InstanceCount() { 515 int WebFrame::InstanceCount() {
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 1061
1062 // Make sure the first letter is upper case. 1062 // Make sure the first letter is upper case.
1063 command.replace(0, 1, command.Substring(0, 1).UpperASCII()); 1063 command.replace(0, 1, command.Substring(0, 1).UpperASCII());
1064 1064
1065 // Remove the trailing ':' if existing. 1065 // Remove the trailing ':' if existing.
1066 if (command[command.length() - 1] == UChar(':')) 1066 if (command[command.length() - 1] == UChar(':'))
1067 command = command.Substring(0, command.length() - 1); 1067 command = command.Substring(0, command.length() - 1);
1068 1068
1069 Node* plugin_lookup_context_node = 1069 Node* plugin_lookup_context_node =
1070 context_menu_node_ && name == "Copy" ? context_menu_node_ : nullptr; 1070 context_menu_node_ && name == "Copy" ? context_menu_node_ : nullptr;
1071 WebPluginContainerBase* plugin_container = 1071 WebPluginContainerImpl* plugin_container =
1072 CurrentPluginContainer(GetFrame(), plugin_lookup_context_node); 1072 CurrentPluginContainer(GetFrame(), plugin_lookup_context_node);
1073 if (plugin_container && plugin_container->ExecuteEditCommand(name)) 1073 if (plugin_container && plugin_container->ExecuteEditCommand(name))
1074 return true; 1074 return true;
1075 1075
1076 return GetFrame()->GetEditor().ExecuteCommand(command); 1076 return GetFrame()->GetEditor().ExecuteCommand(command);
1077 } 1077 }
1078 1078
1079 bool WebLocalFrameImpl::ExecuteCommand(const WebString& name, 1079 bool WebLocalFrameImpl::ExecuteCommand(const WebString& name,
1080 const WebString& value) { 1080 const WebString& value) {
1081 DCHECK(GetFrame()); 1081 DCHECK(GetFrame());
1082 1082
1083 WebPluginContainerBase* plugin_container = CurrentPluginContainer(GetFrame()); 1083 WebPluginContainerImpl* plugin_container = CurrentPluginContainer(GetFrame());
1084 if (plugin_container && plugin_container->ExecuteEditCommand(name, value)) 1084 if (plugin_container && plugin_container->ExecuteEditCommand(name, value))
1085 return true; 1085 return true;
1086 1086
1087 return GetFrame()->GetEditor().ExecuteCommand(name, value); 1087 return GetFrame()->GetEditor().ExecuteCommand(name, value);
1088 } 1088 }
1089 1089
1090 bool WebLocalFrameImpl::IsCommandEnabled(const WebString& name) const { 1090 bool WebLocalFrameImpl::IsCommandEnabled(const WebString& name) const {
1091 DCHECK(GetFrame()); 1091 DCHECK(GetFrame());
1092 return GetFrame()->GetEditor().CreateCommand(name).IsEnabled(); 1092 return GetFrame()->GetEditor().CreateCommand(name).IsEnabled();
1093 } 1093 }
(...skipping 27 matching lines...) Expand all
1121 } 1121 }
1122 1122
1123 void WebLocalFrameImpl::RemoveSpellingMarkersUnderWords( 1123 void WebLocalFrameImpl::RemoveSpellingMarkersUnderWords(
1124 const WebVector<WebString>& words) { 1124 const WebVector<WebString>& words) {
1125 Vector<String> converted_words; 1125 Vector<String> converted_words;
1126 converted_words.Append(words.Data(), words.size()); 1126 converted_words.Append(words.Data(), words.size());
1127 GetFrame()->RemoveSpellingMarkersUnderWords(converted_words); 1127 GetFrame()->RemoveSpellingMarkersUnderWords(converted_words);
1128 } 1128 }
1129 1129
1130 bool WebLocalFrameImpl::HasSelection() const { 1130 bool WebLocalFrameImpl::HasSelection() const {
1131 WebPluginContainerBase* plugin_container = 1131 WebPluginContainerImpl* plugin_container =
1132 PluginContainerFromFrame(GetFrame()); 1132 PluginContainerFromFrame(GetFrame());
1133 if (plugin_container) 1133 if (plugin_container)
1134 return plugin_container->Plugin()->HasSelection(); 1134 return plugin_container->Plugin()->HasSelection();
1135 1135
1136 // frame()->selection()->isNone() never returns true. 1136 // frame()->selection()->isNone() never returns true.
1137 return GetFrame() 1137 return GetFrame()
1138 ->Selection() 1138 ->Selection()
1139 .ComputeVisibleSelectionInDOMTreeDeprecated() 1139 .ComputeVisibleSelectionInDOMTreeDeprecated()
1140 .Start() != GetFrame() 1140 .Start() != GetFrame()
1141 ->Selection() 1141 ->Selection()
1142 .ComputeVisibleSelectionInDOMTreeDeprecated() 1142 .ComputeVisibleSelectionInDOMTreeDeprecated()
1143 .end(); 1143 .end();
1144 } 1144 }
1145 1145
1146 WebRange WebLocalFrameImpl::SelectionRange() const { 1146 WebRange WebLocalFrameImpl::SelectionRange() const {
1147 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets 1147 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
1148 // needs to be audited. See http://crbug.com/590369 for more details. 1148 // needs to be audited. See http://crbug.com/590369 for more details.
1149 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); 1149 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
1150 1150
1151 return GetFrame() 1151 return GetFrame()
1152 ->Selection() 1152 ->Selection()
1153 .ComputeVisibleSelectionInDOMTreeDeprecated() 1153 .ComputeVisibleSelectionInDOMTreeDeprecated()
1154 .ToNormalizedEphemeralRange(); 1154 .ToNormalizedEphemeralRange();
1155 } 1155 }
1156 1156
1157 WebString WebLocalFrameImpl::SelectionAsText() const { 1157 WebString WebLocalFrameImpl::SelectionAsText() const {
1158 WebPluginContainerBase* plugin_container = 1158 WebPluginContainerImpl* plugin_container =
1159 PluginContainerFromFrame(GetFrame()); 1159 PluginContainerFromFrame(GetFrame());
1160 if (plugin_container) 1160 if (plugin_container)
1161 return plugin_container->Plugin()->SelectionAsText(); 1161 return plugin_container->Plugin()->SelectionAsText();
1162 1162
1163 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets 1163 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
1164 // needs to be audited. See http://crbug.com/590369 for more details. 1164 // needs to be audited. See http://crbug.com/590369 for more details.
1165 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); 1165 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
1166 1166
1167 String text = GetFrame()->Selection().SelectedText( 1167 String text = GetFrame()->Selection().SelectedText(
1168 TextIteratorBehavior::EmitsObjectReplacementCharacterBehavior()); 1168 TextIteratorBehavior::EmitsObjectReplacementCharacterBehavior());
1169 #if OS(WIN) 1169 #if OS(WIN)
1170 ReplaceNewlinesWithWindowsStyleNewlines(text); 1170 ReplaceNewlinesWithWindowsStyleNewlines(text);
1171 #endif 1171 #endif
1172 ReplaceNBSPWithSpace(text); 1172 ReplaceNBSPWithSpace(text);
1173 return text; 1173 return text;
1174 } 1174 }
1175 1175
1176 WebString WebLocalFrameImpl::SelectionAsMarkup() const { 1176 WebString WebLocalFrameImpl::SelectionAsMarkup() const {
1177 WebPluginContainerBase* plugin_container = 1177 WebPluginContainerImpl* plugin_container =
1178 PluginContainerFromFrame(GetFrame()); 1178 PluginContainerFromFrame(GetFrame());
1179 if (plugin_container) 1179 if (plugin_container)
1180 return plugin_container->Plugin()->SelectionAsMarkup(); 1180 return plugin_container->Plugin()->SelectionAsMarkup();
1181 1181
1182 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets 1182 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
1183 // needs to be audited. See http://crbug.com/590369 for more details. 1183 // needs to be audited. See http://crbug.com/590369 for more details.
1184 // Selection normalization and markup generation require clean layout. 1184 // Selection normalization and markup generation require clean layout.
1185 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); 1185 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
1186 1186
1187 return GetFrame()->Selection().SelectedHTMLForClipboard(); 1187 return GetFrame()->Selection().SelectedHTMLForClipboard();
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 GetFrame()->Selection().SetCaretVisible(visible); 1380 GetFrame()->Selection().SetCaretVisible(visible);
1381 } 1381 }
1382 1382
1383 VisiblePosition WebLocalFrameImpl::VisiblePositionForViewportPoint( 1383 VisiblePosition WebLocalFrameImpl::VisiblePositionForViewportPoint(
1384 const WebPoint& point_in_viewport) { 1384 const WebPoint& point_in_viewport) {
1385 return VisiblePositionForContentsPoint( 1385 return VisiblePositionForContentsPoint(
1386 GetFrame()->View()->ViewportToContents(point_in_viewport), GetFrame()); 1386 GetFrame()->View()->ViewportToContents(point_in_viewport), GetFrame());
1387 } 1387 }
1388 1388
1389 WebPlugin* WebLocalFrameImpl::FocusedPluginIfInputMethodSupported() { 1389 WebPlugin* WebLocalFrameImpl::FocusedPluginIfInputMethodSupported() {
1390 WebPluginContainerBase* container = 1390 WebPluginContainerImpl* container =
1391 WebLocalFrameImpl::CurrentPluginContainer(GetFrame()); 1391 WebLocalFrameImpl::CurrentPluginContainer(GetFrame());
1392 if (container && container->SupportsInputMethod()) 1392 if (container && container->SupportsInputMethod())
1393 return container->Plugin(); 1393 return container->Plugin();
1394 return 0; 1394 return 0;
1395 } 1395 }
1396 1396
1397 int WebLocalFrameImpl::PrintBegin(const WebPrintParams& print_params, 1397 int WebLocalFrameImpl::PrintBegin(const WebPrintParams& print_params,
1398 const WebNode& constrain_to_node) { 1398 const WebNode& constrain_to_node) {
1399 DCHECK(!GetFrame()->GetDocument()->IsFrameSet()); 1399 DCHECK(!GetFrame()->GetDocument()->IsFrameSet());
1400 WebPluginContainerBase* plugin_container = nullptr; 1400 WebPluginContainerImpl* plugin_container = nullptr;
1401 if (constrain_to_node.IsNull()) { 1401 if (constrain_to_node.IsNull()) {
1402 // If this is a plugin document, check if the plugin supports its own 1402 // If this is a plugin document, check if the plugin supports its own
1403 // printing. If it does, we will delegate all printing to that. 1403 // printing. If it does, we will delegate all printing to that.
1404 plugin_container = PluginContainerFromFrame(GetFrame()); 1404 plugin_container = PluginContainerFromFrame(GetFrame());
1405 } else { 1405 } else {
1406 // We only support printing plugin nodes for now. 1406 // We only support printing plugin nodes for now.
1407 plugin_container = 1407 plugin_container =
1408 ToWebPluginContainerBase(constrain_to_node.PluginContainer()); 1408 ToWebPluginContainerImpl(constrain_to_node.PluginContainer());
1409 } 1409 }
1410 1410
1411 if (plugin_container && plugin_container->SupportsPaginatedPrint()) 1411 if (plugin_container && plugin_container->SupportsPaginatedPrint())
1412 print_context_ = new ChromePluginPrintContext(GetFrame(), plugin_container, 1412 print_context_ = new ChromePluginPrintContext(GetFrame(), plugin_container,
1413 print_params); 1413 print_params);
1414 else 1414 else
1415 print_context_ = new ChromePrintContext(GetFrame()); 1415 print_context_ = new ChromePrintContext(GetFrame());
1416 1416
1417 FloatRect rect(0, 0, 1417 FloatRect rect(0, 0,
1418 static_cast<float>(print_params.print_content_area.width), 1418 static_cast<float>(print_params.print_content_area.width),
(...skipping 22 matching lines...) Expand all
1441 return print_context_->SpoolSinglePage(canvas, page); 1441 return print_context_->SpoolSinglePage(canvas, page);
1442 } 1442 }
1443 1443
1444 void WebLocalFrameImpl::PrintEnd() { 1444 void WebLocalFrameImpl::PrintEnd() {
1445 DCHECK(print_context_); 1445 DCHECK(print_context_);
1446 print_context_->EndPrintMode(); 1446 print_context_->EndPrintMode();
1447 print_context_.Clear(); 1447 print_context_.Clear();
1448 } 1448 }
1449 1449
1450 bool WebLocalFrameImpl::IsPrintScalingDisabledForPlugin(const WebNode& node) { 1450 bool WebLocalFrameImpl::IsPrintScalingDisabledForPlugin(const WebNode& node) {
1451 WebPluginContainerBase* plugin_container = 1451 WebPluginContainerImpl* plugin_container =
1452 node.IsNull() ? PluginContainerFromFrame(GetFrame()) 1452 node.IsNull() ? PluginContainerFromFrame(GetFrame())
1453 : ToWebPluginContainerBase(node.PluginContainer()); 1453 : ToWebPluginContainerImpl(node.PluginContainer());
1454 1454
1455 if (!plugin_container || !plugin_container->SupportsPaginatedPrint()) 1455 if (!plugin_container || !plugin_container->SupportsPaginatedPrint())
1456 return false; 1456 return false;
1457 1457
1458 return plugin_container->IsPrintScalingDisabled(); 1458 return plugin_container->IsPrintScalingDisabled();
1459 } 1459 }
1460 1460
1461 bool WebLocalFrameImpl::GetPrintPresetOptionsForPlugin( 1461 bool WebLocalFrameImpl::GetPrintPresetOptionsForPlugin(
1462 const WebNode& node, 1462 const WebNode& node,
1463 WebPrintPresetOptions* preset_options) { 1463 WebPrintPresetOptions* preset_options) {
1464 WebPluginContainerBase* plugin_container = 1464 WebPluginContainerImpl* plugin_container =
1465 node.IsNull() ? PluginContainerFromFrame(GetFrame()) 1465 node.IsNull() ? PluginContainerFromFrame(GetFrame())
1466 : ToWebPluginContainerBase(node.PluginContainer()); 1466 : ToWebPluginContainerImpl(node.PluginContainer());
1467 1467
1468 if (!plugin_container || !plugin_container->SupportsPaginatedPrint()) 1468 if (!plugin_container || !plugin_container->SupportsPaginatedPrint())
1469 return false; 1469 return false;
1470 1470
1471 return plugin_container->GetPrintPresetOptionsFromDocument(preset_options); 1471 return plugin_container->GetPrintPresetOptionsFromDocument(preset_options);
1472 } 1472 }
1473 1473
1474 bool WebLocalFrameImpl::HasCustomPageSizeStyle(int page_index) { 1474 bool WebLocalFrameImpl::HasCustomPageSizeStyle(int page_index) {
1475 return GetFrame() 1475 return GetFrame()
1476 ->GetDocument() 1476 ->GetDocument()
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1916 1916
1917 void WebLocalFrameImpl::DidFail(const ResourceError& error, 1917 void WebLocalFrameImpl::DidFail(const ResourceError& error,
1918 bool was_provisional, 1918 bool was_provisional,
1919 HistoryCommitType commit_type) { 1919 HistoryCommitType commit_type) {
1920 if (!Client()) 1920 if (!Client())
1921 return; 1921 return;
1922 WebURLError web_error = error; 1922 WebURLError web_error = error;
1923 WebHistoryCommitType web_commit_type = 1923 WebHistoryCommitType web_commit_type =
1924 static_cast<WebHistoryCommitType>(commit_type); 1924 static_cast<WebHistoryCommitType>(commit_type);
1925 1925
1926 if (WebPluginContainerBase* plugin = PluginContainerFromFrame(GetFrame())) 1926 if (WebPluginContainerImpl* plugin = PluginContainerFromFrame(GetFrame()))
1927 plugin->DidFailLoading(error); 1927 plugin->DidFailLoading(error);
1928 1928
1929 if (was_provisional) 1929 if (was_provisional)
1930 Client()->DidFailProvisionalLoad(web_error, web_commit_type); 1930 Client()->DidFailProvisionalLoad(web_error, web_commit_type);
1931 else 1931 else
1932 Client()->DidFailLoad(web_error, web_commit_type); 1932 Client()->DidFailLoad(web_error, web_commit_type);
1933 } 1933 }
1934 1934
1935 void WebLocalFrameImpl::DidFinish() { 1935 void WebLocalFrameImpl::DidFinish() {
1936 if (!Client()) 1936 if (!Client())
1937 return; 1937 return;
1938 1938
1939 if (WebPluginContainerBase* plugin = PluginContainerFromFrame(GetFrame())) 1939 if (WebPluginContainerImpl* plugin = PluginContainerFromFrame(GetFrame()))
1940 plugin->DidFinishLoading(); 1940 plugin->DidFinishLoading();
1941 1941
1942 Client()->DidFinishLoad(); 1942 Client()->DidFinishLoad();
1943 } 1943 }
1944 1944
1945 void WebLocalFrameImpl::SetCanHaveScrollbars(bool can_have_scrollbars) { 1945 void WebLocalFrameImpl::SetCanHaveScrollbars(bool can_have_scrollbars) {
1946 if (FrameView* view = GetFrameView()) 1946 if (FrameView* view = GetFrameView())
1947 view->SetCanHaveScrollbars(can_have_scrollbars); 1947 view->SetCanHaveScrollbars(can_have_scrollbars);
1948 } 1948 }
1949 1949
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
2617 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { 2617 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const {
2618 return *text_checker_client_; 2618 return *text_checker_client_;
2619 } 2619 }
2620 2620
2621 void WebLocalFrameImpl::SetTextCheckClient( 2621 void WebLocalFrameImpl::SetTextCheckClient(
2622 WebTextCheckClient* text_check_client) { 2622 WebTextCheckClient* text_check_client) {
2623 text_check_client_ = text_check_client; 2623 text_check_client_ = text_check_client;
2624 } 2624 }
2625 2625
2626 } // namespace blink 2626 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.h ('k') | third_party/WebKit/Source/web/WebNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698