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

Side by Side Diff: Source/WebKit/chromium/src/WebFrameImpl.cpp

Issue 15071004: Plumb edit commands to plugins (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Alternative approach that gives plugin chance to override 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) 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 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 else if (command == "AdvanceToNextMisspelling") { 1221 else if (command == "AdvanceToNextMisspelling") {
1222 // Wee need to pass false here or else the currently selected word will never be skipped. 1222 // Wee need to pass false here or else the currently selected word will never be skipped.
1223 frame()->editor()->advanceToNextMisspelling(false); 1223 frame()->editor()->advanceToNextMisspelling(false);
1224 } else if (command == "ToggleSpellPanel") 1224 } else if (command == "ToggleSpellPanel")
1225 frame()->editor()->showSpellingGuessPanel(); 1225 frame()->editor()->showSpellingGuessPanel();
1226 else 1226 else
1227 result = frame()->editor()->command(command).execute(); 1227 result = frame()->editor()->command(command).execute();
1228 return result; 1228 return result;
1229 } 1229 }
1230 1230
1231 bool WebFrameImpl::executeCommand(const WebString& name, const WebString& value) 1231 bool WebFrameImpl::executeCommand(const WebString& name, const WebString& value, const WebNode& node)
1232 { 1232 {
1233 ASSERT(frame()); 1233 ASSERT(frame());
1234 String webName = name; 1234 String webName = name;
1235 1235
1236 WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame());
1237 if (!pluginContainer)
1238 pluginContainer = static_cast<WebPluginContainerImpl*>(node.pluginContai ner());
abarth-chromium 2013/05/28 16:34:31 Should we have an inline helper function that impl
Fady Samuel 2013/05/29 04:40:06 Done.
1239 if (pluginContainer && pluginContainer->executeEditCommand(name, value))
1240 return true;
1241
1236 // moveToBeginningOfDocument and moveToEndfDocument are only handled by WebK it for editable nodes. 1242 // moveToBeginningOfDocument and moveToEndfDocument are only handled by WebK it for editable nodes.
1237 if (!frame()->editor()->canEdit() && webName == "moveToBeginningOfDocument") 1243 if (!frame()->editor()->canEdit() && webName == "moveToBeginningOfDocument")
1238 return viewImpl()->propagateScroll(ScrollUp, ScrollByDocument); 1244 return viewImpl()->propagateScroll(ScrollUp, ScrollByDocument);
1239 1245
1240 if (!frame()->editor()->canEdit() && webName == "moveToEndOfDocument") 1246 if (!frame()->editor()->canEdit() && webName == "moveToEndOfDocument")
1241 return viewImpl()->propagateScroll(ScrollDown, ScrollByDocument); 1247 return viewImpl()->propagateScroll(ScrollDown, ScrollByDocument);
1242 1248
1243 return frame()->editor()->command(webName).execute(value); 1249 return frame()->editor()->command(webName).execute(value);
1244 } 1250 }
1245 1251
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
2497 2503
2498 // There is a possibility that the frame being detached was the only 2504 // There is a possibility that the frame being detached was the only
2499 // pending one. We need to make sure final replies can be sent. 2505 // pending one. We need to make sure final replies can be sent.
2500 flushCurrentScopingEffort(m_findRequestIdentifier); 2506 flushCurrentScopingEffort(m_findRequestIdentifier);
2501 2507
2502 cancelPendingScopingEffort(); 2508 cancelPendingScopingEffort();
2503 } 2509 }
2504 } 2510 }
2505 2511
2506 } // namespace WebKit 2512 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698