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

Unified Diff: chrome/common/spellcheck_result.h

Issue 9368052: Removed WebTextCheckingResult legacy API use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another trial... Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/spellcheck_messages.h ('k') | chrome/renderer/spellchecker/spellcheck.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/spellcheck_result.h
diff --git a/chrome/common/spellcheck_result.h b/chrome/common/spellcheck_result.h
new file mode 100644
index 0000000000000000000000000000000000000000..dfe23dcce2245e9144f89b80002ab49e6e17e4c7
--- /dev/null
+++ b/chrome/common/spellcheck_result.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_COMMON_SPELLCHECK_RESULT_H_
+#define CHROME_COMMON_SPELLCHECK_RESULT_H_
+#pragma once
+
+#include "base/string16.h"
+
+// This class mirrors WebKit::WebTextCheckingResult which holds a
+// misspelled range inside the checked text. It also contains a
+// possible replacement of the misspelling if it is available.
+//
+// Although SpellCheckResult::Type defines various values Chromium
+// only uses the |Spelling| type. otehr values are just reflecting the
+// enum definition in the original WebKit class.
+//
+struct SpellCheckResult {
+ enum Type {
+ SPELLING = 1 << 1,
+ GRAMMAR = 1 << 2,
+ LINK = 1 << 5,
+ QUOTE = 1 << 6,
+ DASH = 1 << 7,
+ REPLACEMENT = 1 << 8,
+ CORRECTION = 1 << 9,
+ SHOWCORRECTIONPANEL = 1 << 10
+ };
+
+ explicit SpellCheckResult(
+ Type t = SPELLING,
+ int loc = 0,
+ int len = 0,
+ const string16& rep = string16())
+ : type(t), location(loc), length(len), replacement(rep) {
+ }
+
+ Type type;
+ int location;
+ int length;
+ string16 replacement;
+};
+
+#endif // CHROME_COMMON_SPELLCHECK_RESULT_H_
« no previous file with comments | « chrome/common/spellcheck_messages.h ('k') | chrome/renderer/spellchecker/spellcheck.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698