| 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/mode_indicator_controller.h" | 5 #include "chrome/browser/chromeos/input_method/mode_indicator_controller.h" |
| 6 | 6 |
| 7 #include "ash/ime/mode_indicator_view.h" | 7 #include "ash/ime/mode_indicator_view.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 return g_mode_indicator_observer_for_testing_; | 85 return g_mode_indicator_observer_for_testing_; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void ModeIndicatorController::InputMethodChanged(InputMethodManager* manager, | 88 void ModeIndicatorController::InputMethodChanged(InputMethodManager* manager, |
| 89 bool show_message) { | 89 bool show_message) { |
| 90 if (!show_message) | 90 if (!show_message) |
| 91 return; | 91 return; |
| 92 ShowModeIndicator(); | 92 ShowModeIndicator(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void ModeIndicatorController::InputMethodPropertyChanged( |
| 96 InputMethodManager* manager) { |
| 97 // Do nothing. |
| 98 } |
| 99 |
| 95 void ModeIndicatorController::ShowModeIndicator() { | 100 void ModeIndicatorController::ShowModeIndicator() { |
| 96 // TODO(komatsu): When this is permanently enabled by defalut, | 101 // TODO(komatsu): When this is permanently enabled by defalut, |
| 97 // delete command_line.h and chromeos_switches.h from the header | 102 // delete command_line.h and chromeos_switches.h from the header |
| 98 // files. | 103 // files. |
| 99 if (CommandLine::ForCurrentProcess()->HasSwitch( | 104 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 100 switches::kDisableIMEModeIndicator)) | 105 switches::kDisableIMEModeIndicator)) |
| 101 return; | 106 return; |
| 102 | 107 |
| 103 // TODO(komatsu): Show the mode indicator in the right bottom of the | 108 // TODO(komatsu): Show the mode indicator in the right bottom of the |
| 104 // display when the launch bar is hidden and the focus is out. To | 109 // display when the launch bar is hidden and the focus is out. To |
| (...skipping 18 matching lines...) Expand all Loading... |
| 123 views::Widget* mi_widget = mi_view->GetWidget(); | 128 views::Widget* mi_widget = mi_view->GetWidget(); |
| 124 if (GetModeIndicatorObserverForTesting()) | 129 if (GetModeIndicatorObserverForTesting()) |
| 125 GetModeIndicatorObserverForTesting()->AddModeIndicatorWidget(mi_widget); | 130 GetModeIndicatorObserverForTesting()->AddModeIndicatorWidget(mi_widget); |
| 126 | 131 |
| 127 mi_observer_->AddModeIndicatorWidget(mi_widget); | 132 mi_observer_->AddModeIndicatorWidget(mi_widget); |
| 128 mi_view->ShowAndFadeOut(); | 133 mi_view->ShowAndFadeOut(); |
| 129 } | 134 } |
| 130 | 135 |
| 131 } // namespace input_method | 136 } // namespace input_method |
| 132 } // namespace chromeos | 137 } // namespace chromeos |
| OLD | NEW |