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/command_line.h"
8 #include "base/logging.h"
9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/accessibility/accessibility_events.h"
11 #include "chrome/browser/chromeos/input_method/input_method_util.h"
12 #include "chrome/browser/profiles/profile_manager.h"
13 #include "chromeos/chromeos_switches.h"
16 namespace input_method
{
18 Accessibility::Accessibility(InputMethodManager
* imm
)
21 imm_
->AddObserver(this);
24 Accessibility::~Accessibility() {
26 imm_
->RemoveObserver(this);
29 void Accessibility::InputMethodChanged(InputMethodManager
* imm
,
35 // When Mode indicator is disabled, the previous IME massage and its
36 // spoken feedback is used. In that case, this module does not
37 // provide a redundant spoken feedback.
39 // TODO(komatsu): When this is permanently enabled by defalut,
40 // delete command_line.h and chromeos_switches.h from the header
42 if (CommandLine::ForCurrentProcess()->HasSwitch(
43 switches::kDisableIMEModeIndicator
))
46 // Get the medium name of the changed input method (e.g. US, INTL, etc.)
47 const InputMethodDescriptor descriptor
= imm_
->GetCurrentInputMethod();
48 const std::string medium_name
= base::UTF16ToUTF8(
49 imm_
->GetInputMethodUtil()->GetInputMethodMediumName(descriptor
));
51 AccessibilityAlertInfo
event(ProfileManager::GetActiveUserProfile(),
53 SendControlAccessibilityNotification(
54 ui::AccessibilityTypes::EVENT_ALERT
, &event
);
57 void Accessibility::InputMethodPropertyChanged(InputMethodManager
* imm
) {
61 } // namespace input_method
62 } // namespace chromeos