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

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc

Issue 1573903002: Change some functions in ImeEngineObserver as not ChromeOS-only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc b/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc
index db2ad970f82df0cc7c23f70e2ea121c094bc6eb5..7d7e9f68787ea0dc726c8f59eae64e773dc5d5d8 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc
@@ -83,20 +83,6 @@ class ImeObserverChromeOS : public ui::ImeObserver {
~ImeObserverChromeOS() override {}
// ui::IMEEngineObserver overrides
- void OnActivate(const std::string& component_id) override {
- if (extension_id_.empty() ||
- !HasListener(input_ime::OnActivate::kEventName))
- return;
-
- scoped_ptr<base::ListValue> args(input_ime::OnActivate::Create(
- component_id,
- input_ime::ParseScreenType(GetCurrentScreenType())));
-
- DispatchEventToExtension(extensions::events::INPUT_IME_ON_ACTIVATE,
- input_ime::OnActivate::kEventName,
- std::move(args));
- }
-
void OnInputContextUpdate(
const IMEEngineHandlerInterface::InputContext& context) override {
if (extension_id_.empty() ||
@@ -116,10 +102,6 @@ class ImeObserverChromeOS : public ui::ImeObserver {
input_ime::OnInputContextUpdate::kEventName, std::move(args));
}
- bool IsInterestedInKeyEvent() const override {
- return ShouldForwardKeyEvent();
- }
-
void OnCandidateClicked(
const std::string& component_id,
int candidate_id,
@@ -167,28 +149,6 @@ class ImeObserverChromeOS : public ui::ImeObserver {
input_ime::OnMenuItemActivated::kEventName, std::move(args));
}
- void OnSurroundingTextChanged(const std::string& component_id,
- const std::string& text,
- int cursor_pos,
- int anchor_pos,
- int offset_pos) override {
- if (extension_id_.empty() ||
- !HasListener(input_ime::OnSurroundingTextChanged::kEventName))
- return;
-
- input_ime::OnSurroundingTextChanged::SurroundingInfo info;
- info.text = text;
- info.focus = cursor_pos;
- info.anchor = anchor_pos;
- info.offset = offset_pos;
- scoped_ptr<base::ListValue> args(
- input_ime::OnSurroundingTextChanged::Create(component_id, info));
-
- DispatchEventToExtension(
- extensions::events::INPUT_IME_ON_SURROUNDING_TEXT_CHANGED,
- input_ime::OnSurroundingTextChanged::kEventName, std::move(args));
- }
-
void OnCompositionBoundsChanged(
const std::vector<gfx::Rect>& bounds) override {
if (extension_id_.empty() ||
@@ -261,7 +221,7 @@ class ImeObserverChromeOS : public ui::ImeObserver {
// The component IME extensions need to know the current screen type (e.g.
// lock screen, login screen, etc.) so that its on-screen keyboard page
// won't open new windows/pages. See crbug.com/395621.
- std::string GetCurrentScreenType() {
+ std::string GetCurrentScreenType() override {
switch (chromeos::input_method::InputMethodManager::Get()
->GetUISessionState()) {
case chromeos::input_method::InputMethodManager::STATE_LOGIN_SCREEN:

Powered by Google App Engine
This is Rietveld 408576698