| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/input_method/accessibility.h" | 5 #include "chrome/browser/chromeos/input_method/accessibility.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/accessibility/accessibility_events.h" | 9 #include "chrome/browser/accessibility/accessibility_events.h" |
| 10 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 10 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 imm_->RemoveObserver(this); | 24 imm_->RemoveObserver(this); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void Accessibility::InputMethodChanged(InputMethodManager* imm, | 27 void Accessibility::InputMethodChanged(InputMethodManager* imm, |
| 28 bool show_message) { | 28 bool show_message) { |
| 29 DCHECK_EQ(imm, imm_); | 29 DCHECK_EQ(imm, imm_); |
| 30 if (!show_message) | 30 if (!show_message) |
| 31 return; | 31 return; |
| 32 | 32 |
| 33 // Get the medium name of the changed input method (e.g. US, INTL, etc.) | 33 // Get the medium name of the changed input method (e.g. US, INTL, etc.) |
| 34 const InputMethodDescriptor descriptor = imm_->GetCurrentInputMethod(); | 34 const InputMethodDescriptor descriptor = |
| 35 imm_->GetActiveIMEState()->GetCurrentInputMethod(); |
| 35 const std::string medium_name = base::UTF16ToUTF8( | 36 const std::string medium_name = base::UTF16ToUTF8( |
| 36 imm_->GetInputMethodUtil()->GetInputMethodMediumName(descriptor)); | 37 imm_->GetInputMethodUtil()->GetInputMethodMediumName(descriptor)); |
| 37 | 38 |
| 38 AccessibilityAlertInfo event(ProfileManager::GetActiveUserProfile(), | 39 AccessibilityAlertInfo event(ProfileManager::GetActiveUserProfile(), |
| 39 medium_name); | 40 medium_name); |
| 40 SendControlAccessibilityNotification( | 41 SendControlAccessibilityNotification( |
| 41 ui::AX_EVENT_ALERT, &event); | 42 ui::AX_EVENT_ALERT, &event); |
| 42 } | 43 } |
| 43 | 44 |
| 44 } // namespace input_method | 45 } // namespace input_method |
| 45 } // namespace chromeos | 46 } // namespace chromeos |
| OLD | NEW |