1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/input_method/accessibility.h"
7 #include "base/logging.h"
8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/accessibility/accessibility_events.h"
10 #include "chrome/browser/chromeos/input_method/input_method_util.h"
11 #include "chrome/browser/profiles/profile_manager.h"
14 namespace input_method
{
16 Accessibility::Accessibility(InputMethodManager
* imm
)
19 imm_
->AddObserver(this);
22 Accessibility::~Accessibility() {
24 imm_
->RemoveObserver(this);
27 void Accessibility::InputMethodChanged(InputMethodManager
* imm
,
33 // Get the medium name of the changed input method (e.g. US, INTL, etc.)
34 const InputMethodDescriptor descriptor
= imm_
->GetCurrentInputMethod();
35 const std::string medium_name
= base::UTF16ToUTF8(
36 imm_
->GetInputMethodUtil()->GetInputMethodMediumName(descriptor
));
38 AccessibilityAlertInfo
event(ProfileManager::GetActiveUserProfile(),
40 SendControlAccessibilityNotification(
41 ui::AX_EVENT_ALERT
, &event
);
44 } // namespace input_method
45 } // namespace chromeos