Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / ash / system / chromeos / tray_caps_lock.cc
index 9e9d574..7c9925d 100644 (file)
@@ -11,8 +11,8 @@
 #include "ash/system/tray/system_tray_notifier.h"
 #include "ash/system/tray/tray_constants.h"
 #include "base/sys_info.h"
+#include "chromeos/ime/ime_keyboard.h"
 #include "chromeos/ime/input_method_manager.h"
-#include "chromeos/ime/xkeyboard.h"
 #include "grit/ash_resources.h"
 #include "grit/ash_strings.h"
 #include "ui/accessibility/ax_view_state.h"
 #include "ui/views/widget/widget.h"
 
 namespace ash {
-namespace internal {
-
 namespace {
 
 bool CapsLockIsEnabled() {
   chromeos::input_method::InputMethodManager* ime =
       chromeos::input_method::InputMethodManager::Get();
-  return (ime && ime->GetXKeyboard()) ? ime->GetXKeyboard()->CapsLockIsEnabled()
-                                      : false;
+  return (ime && ime->GetImeKeyboard())
+             ? ime->GetImeKeyboard()->CapsLockIsEnabled()
+             : false;
 }
 
 }
@@ -110,13 +109,13 @@ class CapsLockDefaultView : public ActionableView {
 
   // Overridden from ActionableView:
   virtual bool PerformAction(const ui::Event& event) OVERRIDE {
-    chromeos::input_method::XKeyboard* xkeyboard =
-        chromeos::input_method::InputMethodManager::Get()->GetXKeyboard();
+    chromeos::input_method::ImeKeyboard* keyboard =
+        chromeos::input_method::InputMethodManager::Get()->GetImeKeyboard();
     Shell::GetInstance()->metrics()->RecordUserMetricsAction(
-        xkeyboard->CapsLockIsEnabled() ?
+        keyboard->CapsLockIsEnabled() ?
         ash::UMA_STATUS_AREA_CAPS_LOCK_DISABLED_BY_CLICK :
         ash::UMA_STATUS_AREA_CAPS_LOCK_ENABLED_BY_CLICK);
-    xkeyboard->SetCapsLockEnabled(!xkeyboard->CapsLockIsEnabled());
+    keyboard->SetCapsLockEnabled(!keyboard->CapsLockIsEnabled());
     return true;
   }
 
@@ -135,9 +134,9 @@ TrayCapsLock::TrayCapsLock(SystemTray* system_tray)
   // Since keyboard handling differs between ChromeOS and Linux we need to
   // use different observers depending on the two platforms.
   if (base::SysInfo::IsRunningOnChromeOS()) {
-    chromeos::input_method::XKeyboard* xkeyboard =
-        chromeos::input_method::InputMethodManager::Get()->GetXKeyboard();
-    xkeyboard->AddObserver(this);
+    chromeos::input_method::ImeKeyboard* keyboard =
+        chromeos::input_method::InputMethodManager::Get()->GetImeKeyboard();
+    keyboard->AddObserver(this);
   } else {
     Shell::GetInstance()->PrependPreTargetHandler(this);
   }
@@ -147,9 +146,9 @@ TrayCapsLock::~TrayCapsLock() {
   // Since keyboard handling differs between ChromeOS and Linux we need to
   // use different observers depending on the two platforms.
   if (base::SysInfo::IsRunningOnChromeOS()) {
-    chromeos::input_method::XKeyboard* xkeyboard =
-        chromeos::input_method::InputMethodManager::Get()->GetXKeyboard();
-    xkeyboard->RemoveObserver(this);
+    chromeos::input_method::ImeKeyboard* keyboard =
+        chromeos::input_method::InputMethodManager::Get()->GetImeKeyboard();
+    keyboard->RemoveObserver(this);
   } else {
     Shell::GetInstance()->RemovePreTargetHandler(this);
   }
@@ -232,5 +231,4 @@ void TrayCapsLock::DestroyDetailedView() {
   detailed_ = NULL;
 }
 
-}  // namespace internal
 }  // namespace ash