Commit 7df64f60 authored by yusukes@google.com's avatar yusukes@google.com

Remove virtual keyboard support from ui/views/ime/.

This CL depends on https://chromiumcodereview.appspot.com/10399046

BUG=128295
TEST=try

Review URL: https://chromiumcodereview.appspot.com/10416027

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138447 0039d316-1c4b-4281-b951-d872f2087c98
parent d1b3a263
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// 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.
#include "ui/base/ime/text_input_client.h"
#include "ui/views/ime/input_method_base.h"
#include "ui/views/ime/text_input_type_tracker.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
......@@ -50,14 +49,10 @@ void InputMethodBase::Init(Widget* widget) {
void InputMethodBase::OnFocus() {
widget_focused_ = true;
TextInputTypeTracker::GetInstance()->OnTextInputTypeChanged(
GetTextInputType(), widget_);
}
void InputMethodBase::OnBlur() {
widget_focused_ = false;
TextInputTypeTracker::GetInstance()->OnTextInputTypeChanged(
GetTextInputType(), widget_);
}
views::View* InputMethodBase::GetFocusedView() const {
......@@ -65,10 +60,6 @@ views::View* InputMethodBase::GetFocusedView() const {
}
void InputMethodBase::OnTextInputTypeChanged(View* view) {
if (IsViewFocused(view)) {
TextInputTypeTracker::GetInstance()->OnTextInputTypeChanged(
GetTextInputType(), widget_);
}
}
ui::TextInputClient* InputMethodBase::GetTextInputClient() const {
......@@ -89,10 +80,6 @@ void InputMethodBase::OnWillChangeFocus(View* focused_before, View* focused) {
}
void InputMethodBase::OnDidChangeFocus(View* focused_before, View* focused) {
if (widget_focused_) {
TextInputTypeTracker::GetInstance()->OnTextInputTypeChanged(
GetTextInputType(), widget_);
}
}
bool InputMethodBase::IsViewFocused(View* view) const {
......
// Copyright (c) 2011 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 "ui/views/ime/text_input_type_tracker.h"
namespace views {
void TextInputTypeTracker::AddTextInputTypeObserver(
TextInputTypeObserver* observer) {
text_input_type_observers_.AddObserver(observer);
}
void TextInputTypeTracker::RemoveTextInputTypeObserver(
TextInputTypeObserver* observer) {
text_input_type_observers_.RemoveObserver(observer);
}
void TextInputTypeTracker::OnTextInputTypeChanged(
ui::TextInputType type, Widget* widget) {
FOR_EACH_OBSERVER(TextInputTypeObserver,
text_input_type_observers_,
TextInputTypeChanged(type, widget));
}
TextInputTypeTracker::TextInputTypeTracker() {
}
TextInputTypeTracker::~TextInputTypeTracker() {
}
// static
TextInputTypeTracker* TextInputTypeTracker::GetInstance() {
return Singleton<TextInputTypeTracker>::get();
}
} // namespace views
// Copyright (c) 2011 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 UI_VIEWS_IME_TEXT_INPUT_TYPE_TRACKER_H_
#define UI_VIEWS_IME_TEXT_INPUT_TYPE_TRACKER_H_
#pragma once
#include "base/memory/singleton.h"
#include "base/observer_list.h"
#include "ui/base/ime/text_input_type.h"
#include "ui/views/views_export.h"
namespace views {
class Widget;
// This interface should be implemented by classes that want to be notified when
// the text input type of the focused widget is changed or the focused widget is
// changed.
class TextInputTypeObserver {
public:
// This function will be called, when the text input type of focused |widget|
// is changed or the the widget is getting/losing focus.
virtual void TextInputTypeChanged(ui::TextInputType type, Widget* widget) = 0;
protected:
virtual ~TextInputTypeObserver() {}
};
// This class is for tracking the text input type of focused widget.
class VIEWS_EXPORT TextInputTypeTracker {
public:
// Returns the singleton instance.
static TextInputTypeTracker* GetInstance();
// Adds/removes a TextInputTypeObserver |observer| to the set of
// active observers.
void AddTextInputTypeObserver(TextInputTypeObserver* observer);
void RemoveTextInputTypeObserver(TextInputTypeObserver* observer);
// views::InputMethod should call this function with new text input |type| and
// the |widget| associated with the input method, when the text input type
// is changed.
// Note: The widget should have focus or is losing focus.
void OnTextInputTypeChanged(ui::TextInputType type, Widget* widget);
private:
TextInputTypeTracker();
~TextInputTypeTracker();
ObserverList<TextInputTypeObserver> text_input_type_observers_;
friend struct DefaultSingletonTraits<TextInputTypeTracker>;
DISALLOW_COPY_AND_ASSIGN(TextInputTypeTracker);
};
} // namespace views
#endif // UI_VIEWS_IME_TEXT_INPUT_TYPE_TRACKER_H_
......@@ -268,8 +268,6 @@
'ime/input_method_win.h',
'ime/mock_input_method.cc',
'ime/mock_input_method.h',
'ime/text_input_type_tracker.cc',
'ime/text_input_type_tracker.h',
'layout/box_layout.cc',
'layout/box_layout.h',
'layout/fill_layout.cc',
......
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