This source file includes following definitions.
- InputMethodChanged
#include "chrome/browser/chromeos/input_method/accessibility.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/accessibility/accessibility_events.h"
#include "chrome/browser/chromeos/input_method/input_method_util.h"
#include "chrome/browser/profiles/profile_manager.h"
namespace chromeos {
namespace input_method {
Accessibility::Accessibility(InputMethodManager* imm)
: imm_(imm) {
DCHECK(imm_);
imm_->AddObserver(this);
}
Accessibility::~Accessibility() {
DCHECK(imm_);
imm_->RemoveObserver(this);
}
void Accessibility::InputMethodChanged(InputMethodManager* imm,
bool show_message) {
DCHECK_EQ(imm, imm_);
if (!show_message)
return;
const InputMethodDescriptor descriptor = imm_->GetCurrentInputMethod();
const std::string medium_name = base::UTF16ToUTF8(
imm_->GetInputMethodUtil()->GetInputMethodMediumName(descriptor));
AccessibilityAlertInfo event(ProfileManager::GetActiveUserProfile(),
medium_name);
SendControlAccessibilityNotification(
ui::AX_EVENT_ALERT, &event);
}
}
}