Commit dc9c852a authored by aestes@apple.com's avatar aestes@apple.com

Disentangle code that relies on USE(AUTOMATIC_TEXT_REPLACEMENT) from that...

Disentangle code that relies on USE(AUTOMATIC_TEXT_REPLACEMENT) from that which merely relies on PLATFORM(MAC)
https://bugs.webkit.org/show_bug.cgi?id=87933

Reviewed by Dan Bernstein.

Source/WebCore:

* editing/Editor.cpp:
* editing/Editor.h:
* loader/EmptyClients.h:
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/EditorClient.h:

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 29603069
2012-05-31 Andy Estes <aestes@apple.com>
Disentangle code that relies on USE(AUTOMATIC_TEXT_REPLACEMENT) from that which merely relies on PLATFORM(MAC)
https://bugs.webkit.org/show_bug.cgi?id=87933
Reviewed by Dan Bernstein.
* editing/Editor.cpp:
* editing/Editor.h:
* loader/EmptyClients.h:
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/EditorClient.h:
2012-05-31 Dana Jansens <danakj@chromium.org>
[chromium] Move drawing code for RenderSurfaces into LayerRendererChromium
......
......@@ -1116,7 +1116,7 @@ int Editor::spellCheckerDocumentTag()
return client() ? client()->spellCheckerDocumentTag() : 0;
}
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
#if PLATFORM(MAC)
void Editor::uppercaseWord()
{
......@@ -1135,6 +1135,10 @@ void Editor::capitalizeWord()
if (client())
client()->capitalizeWord();
}
#endif
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
void Editor::showSubstitutionsPanel()
{
......
......@@ -233,10 +233,12 @@ public:
void markMisspellingsAndBadGrammar(const VisibleSelection& spellingSelection, bool markGrammar, const VisibleSelection& grammarSelection);
void markAndReplaceFor(PassRefPtr<SpellCheckRequest>, const Vector<TextCheckingResult>&);
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
#if PLATFORM(MAC)
void uppercaseWord();
void lowercaseWord();
void capitalizeWord();
#endif
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
void showSubstitutionsPanel();
bool substitutionsPanelIsShowing();
void toggleSmartInsertDelete();
......
......@@ -499,10 +499,13 @@ public:
virtual NSURL* canonicalizeURL(NSURL*) { return 0; }
virtual NSURL* canonicalizeURLString(NSString*) { return 0; }
#endif
#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
#if PLATFORM(MAC)
virtual void uppercaseWord() { }
virtual void lowercaseWord() { }
virtual void capitalizeWord() { }
#endif
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
virtual void showSubstitutionsPanel(bool) { }
virtual bool substitutionsPanelIsShowing() { return false; }
virtual void toggleSmartInsertDelete() { }
......
......@@ -446,6 +446,11 @@ void ContextMenuController::contextMenuItemSelected(ContextMenuItem* item)
case ContextMenuItemTagCapitalize:
frame->editor()->capitalizeWord();
break;
case ContextMenuItemTagChangeBack:
frame->editor()->changeBackToReplacedString(m_hitTestResult.replacedString());
break;
#endif
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
case ContextMenuItemTagShowSubstitutions:
frame->editor()->showSubstitutionsPanel();
break;
......@@ -467,9 +472,6 @@ void ContextMenuController::contextMenuItemSelected(ContextMenuItem* item)
case ContextMenuItemTagCorrectSpellingAutomatically:
frame->editor()->toggleAutomaticSpellingCorrection();
break;
case ContextMenuItemTagChangeBack:
frame->editor()->changeBackToReplacedString(m_hitTestResult.replacedString());
break;
#endif
#if ENABLE(INSPECTOR)
case ContextMenuItemTagInspectElement:
......
......@@ -30,6 +30,7 @@
#include "EditorInsertAction.h"
#include "FloatRect.h"
#include "TextAffinity.h"
#include "TextChecking.h"
#include "UndoStep.h"
#include <wtf/Forward.h>
#include <wtf/Vector.h>
......@@ -121,10 +122,12 @@ public:
virtual NSURL* canonicalizeURLString(NSString*) = 0;
#endif
#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
#if PLATFORM(MAC)
virtual void uppercaseWord() = 0;
virtual void lowercaseWord() = 0;
virtual void capitalizeWord() = 0;
#endif
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
virtual void showSubstitutionsPanel(bool show) = 0;
virtual bool substitutionsPanelIsShowing() = 0;
virtual void toggleSmartInsertDelete() = 0;
......
2012-05-31 Andy Estes <aestes@apple.com>
Disentangle code that relies on USE(AUTOMATIC_TEXT_REPLACEMENT) from that which merely relies on PLATFORM(MAC)
https://bugs.webkit.org/show_bug.cgi?id=87933
Reviewed by Dan Bernstein.
* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
2012-05-29 David Barr <davidbarr@chromium.org>
Introduce ENABLE_CSS_IMAGE_RESOLUTION compile flag
......
......@@ -76,10 +76,11 @@ public:
virtual NSURL* canonicalizeURL(NSURL*) OVERRIDE;
virtual NSURL* canonicalizeURLString(NSString*) OVERRIDE;
#ifndef BUILDING_ON_LEOPARD
virtual void uppercaseWord() OVERRIDE;
virtual void lowercaseWord() OVERRIDE;
virtual void capitalizeWord() OVERRIDE;
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
virtual void showSubstitutionsPanel(bool show) OVERRIDE;
virtual bool substitutionsPanelIsShowing() OVERRIDE;
virtual void toggleSmartInsertDelete() OVERRIDE;
......
......@@ -376,8 +376,6 @@ void WebEditorClient::setInsertionPasteboard(const String& pasteboardName)
[m_webView _setInsertionPasteboard:pasteboard];
}
#ifndef BUILDING_ON_LEOPARD
void WebEditorClient::uppercaseWord()
{
[m_webView uppercaseWord:nil];
......@@ -393,6 +391,7 @@ void WebEditorClient::capitalizeWord()
[m_webView capitalizeWord:nil];
}
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
void WebEditorClient::showSubstitutionsPanel(bool show)
{
NSPanel *spellingPanel = [[NSSpellChecker sharedSpellChecker] substitutionsPanel];
......@@ -461,7 +460,7 @@ void WebEditorClient::toggleAutomaticSpellingCorrection()
{
[m_webView toggleAutomaticSpellingCorrection:nil];
}
#endif
#endif // USE(AUTOMATIC_TEXT_REPLACEMENT)
bool WebEditorClient::shouldInsertNode(Node *node, Range* replacingRange, EditorInsertAction givenAction)
{
......
2012-05-31 Andy Estes <aestes@apple.com>
Disentangle code that relies on USE(AUTOMATIC_TEXT_REPLACEMENT) from that which merely relies on PLATFORM(MAC)
https://bugs.webkit.org/show_bug.cgi?id=87933
Reviewed by Dan Bernstein.
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2012-05-31 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add webkit_download_get_request to WebKit2 GTK+ API
......
......@@ -100,10 +100,12 @@ private:
virtual NSURL* canonicalizeURLString(NSString*) OVERRIDE;
#endif
#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)
#if PLATFORM(MAC)
virtual void uppercaseWord() OVERRIDE;
virtual void lowercaseWord() OVERRIDE;
virtual void capitalizeWord() OVERRIDE;
#endif
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
virtual void showSubstitutionsPanel(bool show) OVERRIDE;
virtual bool substitutionsPanelIsShowing() OVERRIDE;
virtual void toggleSmartInsertDelete() OVERRIDE;
......
......@@ -160,6 +160,7 @@ void WebEditorClient::capitalizeWord()
changeWordCase(m_page, @selector(capitalizedString));
}
#if USE(AUTOMATIC_TEXT_REPLACEMENT)
void WebEditorClient::showSubstitutionsPanel(bool)
{
notImplemented();
......@@ -231,6 +232,7 @@ void WebEditorClient::toggleAutomaticSpellingCorrection()
{
notImplemented();
}
#endif // USE(AUTOMATIC_TEXT_REPLACEMENT)
void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, WebCore::TextCheckingTypeMask checkingTypes, Vector<TextCheckingResult>& results)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment