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

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

Issue 2816263003: Move spelling marker related functions from WebView to WebLocalFrame (Closed)
Patch Set: Created 3 years, 8 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 #include "core/dom/Node.h" 109 #include "core/dom/Node.h"
110 #include "core/dom/NodeTraversal.h" 110 #include "core/dom/NodeTraversal.h"
111 #include "core/dom/shadow/ShadowRoot.h" 111 #include "core/dom/shadow/ShadowRoot.h"
112 #include "core/editing/EditingUtilities.h" 112 #include "core/editing/EditingUtilities.h"
113 #include "core/editing/Editor.h" 113 #include "core/editing/Editor.h"
114 #include "core/editing/FrameSelection.h" 114 #include "core/editing/FrameSelection.h"
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/serializers/Serialization.h" 120 #include "core/editing/serializers/Serialization.h"
120 #include "core/editing/spellcheck/SpellChecker.h" 121 #include "core/editing/spellcheck/SpellChecker.h"
121 #include "core/frame/FrameView.h" 122 #include "core/frame/FrameView.h"
122 #include "core/frame/LocalDOMWindow.h" 123 #include "core/frame/LocalDOMWindow.h"
123 #include "core/frame/PageScaleConstraintsSet.h" 124 #include "core/frame/PageScaleConstraintsSet.h"
124 #include "core/frame/RemoteFrame.h" 125 #include "core/frame/RemoteFrame.h"
125 #include "core/frame/ScreenOrientationController.h" 126 #include "core/frame/ScreenOrientationController.h"
126 #include "core/frame/Settings.h" 127 #include "core/frame/Settings.h"
127 #include "core/frame/SmartClip.h" 128 #include "core/frame/SmartClip.h"
128 #include "core/frame/UseCounter.h" 129 #include "core/frame/UseCounter.h"
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 // needs to be audited. see http://crbug.com/590369 for more details. 1108 // needs to be audited. see http://crbug.com/590369 for more details.
1108 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); 1109 GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
1109 1110
1110 GetFrame()->GetSpellChecker().ReplaceMisspelledRange(text); 1111 GetFrame()->GetSpellChecker().ReplaceMisspelledRange(text);
1111 } 1112 }
1112 1113
1113 void WebLocalFrameImpl::RemoveSpellingMarkers() { 1114 void WebLocalFrameImpl::RemoveSpellingMarkers() {
1114 GetFrame()->GetSpellChecker().RemoveSpellingMarkers(); 1115 GetFrame()->GetSpellChecker().RemoveSpellingMarkers();
1115 } 1116 }
1116 1117
1118 void WebLocalFrameImpl::SpellingMarkerOffsetsForTest(
1119 WebVector<unsigned>* offsets) {
1120 Vector<unsigned> result;
1121 const DocumentMarkerVector& document_markers =
1122 GetFrame()->GetDocument()->Markers().Markers();
1123 for (size_t i = 0; i < document_markers.size(); ++i)
1124 result.push_back(document_markers[i]->StartOffset());
1125 offsets->Assign(result);
1126 }
1127
1128 void WebLocalFrameImpl::RemoveSpellingMarkersUnderWords(
1129 const WebVector<WebString>& words) {
1130 Vector<String> converted_words;
1131 converted_words.Append(words.Data(), words.size());
1132 GetFrame()->RemoveSpellingMarkersUnderWords(converted_words);
1133 }
1134
1117 bool WebLocalFrameImpl::HasSelection() const { 1135 bool WebLocalFrameImpl::HasSelection() const {
1118 WebPluginContainerImpl* plugin_container = 1136 WebPluginContainerImpl* plugin_container =
1119 PluginContainerFromFrame(GetFrame()); 1137 PluginContainerFromFrame(GetFrame());
1120 if (plugin_container) 1138 if (plugin_container)
1121 return plugin_container->Plugin()->HasSelection(); 1139 return plugin_container->Plugin()->HasSelection();
1122 1140
1123 // frame()->selection()->isNone() never returns true. 1141 // frame()->selection()->isNone() never returns true.
1124 return GetFrame() 1142 return GetFrame()
1125 ->Selection() 1143 ->Selection()
1126 .ComputeVisibleSelectionInDOMTreeDeprecated() 1144 .ComputeVisibleSelectionInDOMTreeDeprecated()
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after
2567 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { 2585 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const {
2568 return *text_checker_client_; 2586 return *text_checker_client_;
2569 } 2587 }
2570 2588
2571 void WebLocalFrameImpl::SetTextCheckClient( 2589 void WebLocalFrameImpl::SetTextCheckClient(
2572 WebTextCheckClient* text_check_client) { 2590 WebTextCheckClient* text_check_client) {
2573 text_check_client_ = text_check_client; 2591 text_check_client_ = text_check_client;
2574 } 2592 }
2575 2593
2576 } // namespace blink 2594 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698