forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add value to ImeTextSpan::Type enum for misspelling suggestions
Currently, the Type enums in the ImeTextSpan classes (ui::ImeTextSpan, blink::ImeTextSpan, and blink::WebImeTextSpan) define two values: kComposition, for composition markers, and kSuggestion, for Android SuggestionSpans. This CL adds a third value, kMisspellingSuggestion, for Android SuggestionSpans that represent misspellings. Misspelling suggestions will behave differently in two ways from regular suggestions: - They will not be added to an editable region with spell checking disabled. - They will be removed if one of their suggested replacements is chosen. Bug: 672259 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation Change-Id: Ie4b3d2f67ef53b5819380261da5d91ac0209a7ff Reviewed-on: https://chromium-review.googlesource.com/660689 Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Reviewed-by: Will Harris <wfh@chromium.org> Commit-Queue: Ryan Landay <rlanday@chromium.org> Cr-Commit-Position: refs/heads/master@{#501843}
- Loading branch information
Showing
15 changed files
with
96 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2017 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. | ||
|
||
#include "content/common/input/ime_text_span_conversions.h" | ||
|
||
#include "base/logging.h" | ||
|
||
namespace content { | ||
|
||
blink::WebImeTextSpan::Type ConvertUiImeTextSpanTypeToWebType( | ||
ui::ImeTextSpan::Type type) { | ||
switch (type) { | ||
case ui::ImeTextSpan::Type::kComposition: | ||
return blink::WebImeTextSpan::Type::kComposition; | ||
case ui::ImeTextSpan::Type::kSuggestion: | ||
return blink::WebImeTextSpan::Type::kSuggestion; | ||
case ui::ImeTextSpan::Type::kMisspellingSuggestion: | ||
return blink::WebImeTextSpan::Type::kMisspellingSuggestion; | ||
} | ||
|
||
NOTREACHED(); | ||
return blink::WebImeTextSpan::Type::kComposition; | ||
} | ||
|
||
ui::ImeTextSpan::Type ConvertWebImeTextSpanTypeToUiType( | ||
blink::WebImeTextSpan::Type type) { | ||
switch (type) { | ||
case blink::WebImeTextSpan::Type::kComposition: | ||
return ui::ImeTextSpan::Type::kComposition; | ||
case blink::WebImeTextSpan::Type::kSuggestion: | ||
return ui::ImeTextSpan::Type::kSuggestion; | ||
case blink::WebImeTextSpan::Type::kMisspellingSuggestion: | ||
return ui::ImeTextSpan::Type::kMisspellingSuggestion; | ||
} | ||
|
||
NOTREACHED(); | ||
return ui::ImeTextSpan::Type::kComposition; | ||
} | ||
|
||
} // namespace content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2017 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 CONTENT_COMMON_INPUT_IME_TEXT_SPAN_CONVERSIONS_H_ | ||
#define CONTENT_COMMON_INPUT_IME_TEXT_SPAN_CONVERSIONS_H_ | ||
|
||
#include "third_party/WebKit/public/web/WebImeTextSpan.h" | ||
#include "ui/base/ime/ime_text_span.h" | ||
|
||
namespace content { | ||
|
||
blink::WebImeTextSpan::Type ConvertUiImeTextSpanTypeToWebType( | ||
ui::ImeTextSpan::Type type); | ||
ui::ImeTextSpan::Type ConvertWebImeTextSpanTypeToUiType( | ||
blink::WebImeTextSpan::Type type); | ||
|
||
} // namespace content | ||
|
||
#endif // CONTENT_COMMON_INPUT_IME_TEXT_SPAN_CONVERSIONS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters