diff options
Diffstat (limited to 'chrome/browser')
5 files changed, 3 insertions, 48 deletions
diff --git a/chrome/browser/chromeos/cros/language_library.cc b/chrome/browser/chromeos/cros/language_library.cc index de2485d..d1dc57c 100644 --- a/chrome/browser/chromeos/cros/language_library.cc +++ b/chrome/browser/chromeos/cros/language_library.cc @@ -147,8 +147,7 @@ std::string LanguageLibrary::GetLanguageCodeFromDescriptor( LanguageLibraryImpl::LanguageLibraryImpl() : input_method_status_connection_(NULL), - current_input_method_("", "", "", ""), - is_focused_(false) { + current_input_method_("", "", "", "") { scoped_ptr<InputMethodDescriptors> input_method_descriptors( CreateFallbackInputMethodDescriptors()); current_input_method_ = input_method_descriptors->at(0); @@ -300,9 +299,8 @@ void LanguageLibraryImpl::UpdatePropertyHandler( // static void LanguageLibraryImpl::FocusChangedHandler(void* object, bool is_focused) { - LanguageLibraryImpl* language_library = - static_cast<LanguageLibraryImpl*>(object); - language_library->FocusChanged(is_focused); + // TODO(yusukes): Remove this function. Modify MonitorInputMethodStatuslibcros + // API as well. } bool LanguageLibraryImpl::EnsureStarted() { @@ -380,17 +378,4 @@ void LanguageLibraryImpl::UpdateProperty(const ImePropertyList& prop_list) { FOR_EACH_OBSERVER(Observer, observers_, ImePropertiesChanged(this)); } -void LanguageLibraryImpl::FocusChanged(bool is_focused) { - if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, - NewRunnableMethod( - this, &LanguageLibraryImpl::FocusChanged, is_focused)); - return; - } - - is_focused_ = is_focused; - FOR_EACH_OBSERVER(Observer, observers_, FocusChanged(this)); -} - } // namespace chromeos diff --git a/chrome/browser/chromeos/cros/language_library.h b/chrome/browser/chromeos/cros/language_library.h index 8c23795..4d90df5 100644 --- a/chrome/browser/chromeos/cros/language_library.h +++ b/chrome/browser/chromeos/cros/language_library.h @@ -26,7 +26,6 @@ class LanguageLibrary { virtual ~Observer() = 0; virtual void InputMethodChanged(LanguageLibrary* obj) = 0; virtual void ImePropertiesChanged(LanguageLibrary* obj) = 0; - virtual void FocusChanged(LanguageLibrary* obj) = 0; }; virtual ~LanguageLibrary() {} @@ -80,7 +79,6 @@ class LanguageLibrary { virtual const InputMethodDescriptor& current_input_method() const = 0; virtual const ImePropertyList& current_ime_properties() const = 0; - virtual bool is_focused() const = 0; // Normalizes the language code and returns the normalized version. The // function normalizes the given language code to be compatible with the @@ -144,10 +142,6 @@ class LanguageLibraryImpl : public LanguageLibrary { return current_ime_properties_; } - virtual bool is_focused() const { - return is_focused_; - } - private: // This method is called when there's a change in input method status. static void InputMethodChangedHandler( @@ -187,9 +181,6 @@ class LanguageLibraryImpl : public LanguageLibrary { // Called by the handler to update input method properties. void UpdateProperty(const ImePropertyList& prop_list); - // Called by the handler to notify focus changes. - void FocusChanged(bool is_focused); - // Tries to send all pending SetImeConfig requests to the input method config // daemon. void FlushImeConfig(); @@ -206,9 +197,6 @@ class LanguageLibraryImpl : public LanguageLibrary { // might be empty when no input method is used. ImePropertyList current_ime_properties_; - // true if a text input area in Chrome is focused. - bool is_focused_; - typedef std::pair<std::string, std::string> ConfigKeyType; typedef std::map<ConfigKeyType, ImeConfigValue> InputMethodConfigRequests; // SetImeConfig requests that are not yet completed. diff --git a/chrome/browser/chromeos/cros/mock_language_library.h b/chrome/browser/chromeos/cros/mock_language_library.h index 4bc120f..62d5a84 100644 --- a/chrome/browser/chromeos/cros/mock_language_library.h +++ b/chrome/browser/chromeos/cros/mock_language_library.h @@ -30,7 +30,6 @@ class MockLanguageLibrary : public LanguageLibrary { const ImeConfigValue&)); MOCK_CONST_METHOD0(current_input_method, const InputMethodDescriptor&(void)); MOCK_CONST_METHOD0(current_ime_properties, const ImePropertyList&(void)); - MOCK_CONST_METHOD0(is_focused, bool(void)); }; } // namespace chromeos diff --git a/chrome/browser/chromeos/status/language_menu_button.cc b/chrome/browser/chromeos/status/language_menu_button.cc index e45dcf5..ead895e6 100644 --- a/chrome/browser/chromeos/status/language_menu_button.cc +++ b/chrome/browser/chromeos/status/language_menu_button.cc @@ -149,12 +149,6 @@ LanguageMenuButton::LanguageMenuButton(StatusAreaHost* host) SetFont(ResourceBundle::GetSharedInstance().GetFont( ResourceBundle::BaseFont).DeriveFont(1, gfx::Font::BOLD)); SetEnabledColor(0xB3FFFFFF); // White with 70% Alpha - - // TODO(yusukes): Make the initial state "enabled" and delete SetDisabledColor - // when crosbug.com/3683 is fixed. - SetDisabledColor(0x4DFFFFFF); // White with 30% Alpha - SetEnabled(false); // Disable the button until the first FocusIn comes in. - SetShowHighlighted(false); // Update the model RebuildModel(); @@ -433,16 +427,6 @@ void LanguageMenuButton::LocaleChanged() { SchedulePaint(); } -void LanguageMenuButton::FocusChanged(LanguageLibrary* obj) { - // TODO(yusukes): Remove this function when crosbug.com/3683 is fixed. - LanguageLibrary* language_library = CrosLibrary::Get()->GetLanguageLibrary(); - if (language_library->is_focused() && !IsEnabled()) { - // Enable the button on the first FocusIn event. - SetEnabled(true); - SchedulePaint(); - } -} - void LanguageMenuButton::UpdateIcon( const std::wstring& name, const std::wstring& tooltip) { if (!tooltip.empty()) { diff --git a/chrome/browser/chromeos/status/language_menu_button.h b/chrome/browser/chromeos/status/language_menu_button.h index 525bd24..a74d5c6 100644 --- a/chrome/browser/chromeos/status/language_menu_button.h +++ b/chrome/browser/chromeos/status/language_menu_button.h @@ -52,7 +52,6 @@ class LanguageMenuButton : public views::MenuButton, // LanguageLibrary::Observer implementation. virtual void InputMethodChanged(LanguageLibrary* obj); virtual void ImePropertiesChanged(LanguageLibrary* obj); - virtual void FocusChanged(LanguageLibrary* obj); // NotificationObserver implementation. virtual void Observe(NotificationType type, |